Repository navigation
Export decimal Widen arrays to Arrow with one copy - #10994
Merged
Merged
Conversation
This was referenced Oct 29, 2026
Merging this PR will not alter performance1 warning
Comparing Footnotes
|
connortsui20
force-pushed
the
ct/decimal-widen
branch
from
October 29, 2026 20:20
29d4a4a to
9c42fc9
Compare
connortsui20
force-pushed
the
ct/widen-arrow-export
branch
from
October 29, 2026 20:23
49a4f52 to
cab830d
Compare
connortsui20
force-pushed
the
ct/decimal-widen
branch
from
October 29, 2026 21:32
9c42fc9 to
fdf9ac2
Compare
connortsui20
force-pushed
the
ct/widen-arrow-export
branch
from
October 29, 2026 21:33
cab830d to
dacf961
Compare
connortsui20
force-pushed
the
ct/decimal-widen
branch
from
October 30, 2026 17:50
fdf9ac2 to
2954c96
Compare
connortsui20
force-pushed
the
ct/widen-arrow-export
branch
2 times, most recently
from
October 30, 2026 19:28
ce4782e to
6ec069f
Compare
connortsui20
force-pushed
the
ct/decimal-widen
branch
3 times, most recently
from
November 2, 2026 16:57
06d9f6e to
fe95c5d
Compare
10 of 23 tasks
connortsui20
force-pushed
the
ct/widen-arrow-export
branch
4 times, most recently
from
November 2, 2026 19:52
7f9cd3f to
1f46b5b
Compare
connortsui20
force-pushed
the
ct/decimal-widen
branch
from
November 2, 2026 20:25
935c065 to
d2eb3da
Compare
connortsui20
force-pushed
the
ct/widen-arrow-export
branch
2 times, most recently
from
November 2, 2026 21:29
773f70c to
b63d378
Compare
connortsui20
force-pushed
the
ct/decimal-widen
branch
from
November 2, 2026 21:29
d2eb3da to
936aa0a
Compare
connortsui20
force-pushed
the
ct/widen-arrow-export
branch
2 times, most recently
from
November 3, 2026 13:36
df07a71 to
ff9883a
Compare
connortsui20
added a commit
that referenced
this pull request
Nov 3, 2026
Tracking Issue: #10701 Based on `develop`, including the writer work previously in #11002. #11003 and #10994 build on it. No release gate. ## Summary Canonical decimal width follows precision, so small values under `Decimal(38, 2)` still occupy 16 bytes each. A decimal `Widen` keeps those values in a lower-precision child while retaining the column's logical dtype. ## Changes The child precision must hold every valid value and have a narrower canonical width. Execution restores the logical width. Until the later kernels land, operations use that canonical fallback. Serialization writes a concrete decimal leaf through the existing `vortex.decimal` wire form without executing values or validity. Integer `Widen` arrays, non-decimal leaves, and nonserializable validity require explicit preparation by the caller. Its metadata stores the width, while the containing format supplies the parent precision. This keeps an `i32` child at four bytes per value, including IPC and writes without a compressor. A serialized-byte regression test checks that size independently of the eventual read encoding. <details> <summary>Historical local benchmark results</summary> These retained measurements predate this style pass and rebase. They do not measure the current head. `cargo bench -p vortex-array --bench widen_decimal`, Apple M4, medians. The numbers were measured at the top of this stack before the split, so they cover the whole stack, not this layer alone. The baseline is the canonical input, and the candidate is the same values as a `Widen` (child precision 5 under precision 10, 9 under 18, and 18 under 38). CodSpeed on this PR measures the layer itself. | bench | p10 canonical | p10 Widen | p18 canonical | p18 Widen | p38 canonical | p38 Widen | | --- | ---: | ---: | ---: | ---: | ---: | ---: | | `filter` | 22.16 µs | 5.083 µs | 13.66 µs | 4.916 µs | 10.58 µs | 24.74 µs | | `execute` | 10.59 ns | 2.832 µs | 10.26 ns | 2.926 µs | 10.34 ns | 9.895 µs | `execute` on a `Widen` is the widening copy, which the canonical input does not need. The canonical `filter` medians at p10 and p18 were bimodal across runs, and `filter` at p38 is slower on the `Widen`. </details> ## API Changes `WidenArray::try_new` accepts decimal children. Adds `WidenArray::encode_decimal` and registers a writer-only `WidenPlugin`, whose only write ID is `vortex.decimal`. ## Validation Source review and rebase range-diffs only. No local tests, builds, linting, or documentation checks were run. A commit hook flagged one formatting wrap, corrected manually without rerunning the check. --------- Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
connortsui20
marked this pull request as ready for review
November 3, 2026 14:41
Export the narrower decimal child directly with the logical precision and scale, avoiding the intermediate canonical-width copy. Skip null payloads when narrowing while still rejecting valid values outside the Arrow width. Keep decimal export coverage in a separate test module. Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
connortsui20
force-pushed
the
ct/widen-arrow-export
branch
from
November 3, 2026 18:36
ff9883a to
e225462
Compare
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
robert3005
approved these changes
Nov 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tracking Issue: #10701
Summary
Executing a narrow decimal
Widento its canonical width before Arrow export can copy the values twice. Exporting its child directly avoids the intermediate copy while preserving the logical precision and scale, including in nested arrays.Changes
Decimal export converts the child's buffer directly to the requested Arrow width. Narrowing skips null payloads, which can contain values too large for that width, and still rejects valid values that do not fit. Tests cover decimal widths, logical precision, nulls, slicing, and nested exports.
API Changes
No public API changes. Decimal export no longer fails solely because a null payload does not fit the Arrow width.
Validation: reviewed the source and confirmed the rebase preserves the Arrow export files. The commit hook ran Rust and TOML formatting checks successfully during the history rewrite. Tests, Clippy, and benchmarks were not run.