Repository navigation
fix(arrow-data): account for FixedSizeList parent offset in MutableArrayData - #11636
Merged
Merged
Conversation
ahlag
marked this pull request as ready for review
October 17, 2026 00:56
Jefffrey
reviewed
Oct 17, 2026
|
|
||
| Box::new( | ||
| move |mutable: &mut _MutableArrayData, index: usize, start: usize, len: usize| { | ||
| let start = start + offset; |
Contributor
There was a problem hiding this comment.
perhaps this should be a checked addition to guard overflows
Contributor
Author
Jefffrey
approved these changes
Oct 17, 2026
Jefffrey
enabled auto-merge
October 17, 2026 07:26
Contributor
|
thanks |
This was referenced Oct 18, 2026
starpact
pushed a commit
to starpact/arrow-rs
that referenced
this pull request
Oct 19, 2026
…ayData (apache#11693) # Which issue does this PR close? - Closes apache#11686. # Rationale for this change `MutableArrayData::extend` on sparse union `ArrayData` with a nonzero offset took the type ids from the right rows but copied the children's values from the rows before the offset. So each type id was paired with the wrong value. A sparse union's children are not sliced by the parent's offset, and `array.buffer::<i8>(0)` applies the offset only to the type ids. # What changes are included in this PR? `build_extend_sparse` in `arrow-data/src/transform/union.rs` adds `array.offset()` to `start` before it extends the children, the same way apache#10934 did for structs and apache#11636 did for fixed size lists. The overflow checks match those two fixes. Dense unions are not changed, because their offsets buffer already gives each row's child index. # Are these changes tested? Yes. `test_extend_sparse_union_accounts_for_parent_offset` in `arrow-data/src/data.rs` (next to the struct and fixed size list tests) builds a sparse union with two children and offset 1, extends it, and checks the type ids and both children. Without the fix, child `a` comes back as `[10, 20]` instead of `[20, 30]`. I also ran `cargo test -p arrow-data`, `cargo test -p arrow --test array_transform`, `cargo test -p arrow-select --lib` and `cargo clippy -p arrow-data --all-targets -- -D warnings`. # Are there any significant user-facing changes? No. AI disclosure: I used an AI coding assistant to write the fix, the test and this description, and I reviewed all of it. The part worth a reviewer's look is that the type ids keep using the already offset buffer while only the children get the added offset.
This was referenced Oct 19, 2026
alamb
pushed a commit
that referenced
this pull request
Oct 19, 2026
…fset in MutableArrayData (#11683) - Backport #11636 - For inclusion in #11664 Cherry-pick of 9827aaa Co-authored-by: Chang Yong Lik <[email protected]>
alamb
pushed a commit
that referenced
this pull request
Oct 21, 2026
…fset in MutableArrayData (#11756) - Backport #11636 - For inclusion in #11665 Cherry-pick of 9827aaa Co-authored-by: Chang Yong Lik <[email protected]>
alamb
pushed a commit
that referenced
this pull request
Oct 22, 2026
…fset in MutableArrayData (#11809) - Backport #11636 - For inclusion in #11666 Cherry-pick of 9827aaa Co-authored-by: Chang Yong Lik <[email protected]>
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.
Which issue does this PR close?
MutableArrayData::extendignores the offset ofFixedSizeListArrayData#11588.Rationale for this change
MutableArrayData::extendon aFixedSizeListwith a nonzero parent offset copied the child values from the start of the child instead of from the offset.What changes are included in this PR?
build_extendintransform/fixed_size_list.rsaddsarray.offset()tostartbefore computing the child range, the same way #10934 did for structs.Are these changes tested?
Yes,
test_extend_fixed_size_list_accounts_for_parent_offsetinarrow-data/src/data.rs(next to the struct test from #10934). It fails without the fix.Are there any significant user-facing changes?
No.
AI use: I used Claude Code to find the cause and write the fix and test. I reviewed the change and checked that the test fails without the fix.