Repository navigation
fix: account for offsets in runarrays when using extend for MutableArrayData - #11546
Merged
Merged
Conversation
Jefffrey
commented
Oct 14, 2026
| ($run_end_type:ty) => {{ | ||
| let last_run_end = get_last_run_end::<$run_end_type>(&mutable.child_data[0]); | ||
| let new_value = last_run_end | ||
| .checked_add(<$run_end_type as ArrowNativeType>::usize_as(len)) |
Contributor
Author
There was a problem hiding this comment.
len is a usize, if it is > i16::MAX and the run index type is i16 the this could wrap to negative
swapping in from_usize which can chain into checked_add and share the same ok_or_else flow
| macro_rules! build_and_process_impl { | ||
| ($run_end_type:ty) => {{ | ||
| let source_buffer = &source_buffer.typed_data() | ||
| [source_buffer_offset..source_buffer_offset + source_buffer_len]; |
Contributor
Author
There was a problem hiding this comment.
in practice it would be uncommon to have a runarray hit this case, of having a runs child arraydata with an offset as it requires manual construction via arraydata
alamb
approved these changes
Oct 14, 2026
| } | ||
|
|
||
| #[test] | ||
| fn test_extend_nulls_overflow() { |
Contributor
There was a problem hiding this comment.
I verified this fails as expected without this change
---- transform::run::tests::test_extend_accounts_for_offset stdout ----
thread 'transform::run::tests::test_extend_accounts_for_offset' (57027272) panicked at arrow-data/src/transform/run.rs:112:53:
called `Option::unwrap()` on a `None` value
---- transform::run::tests::test_extend_nulls_overflow stdout ----
thread 'transform::run::tests::test_extend_nulls_overflow' (57027278) panicked at arrow-data/src/transform/run.rs:722:67:
called `Result::unwrap_err()` on an `Ok` value: ()
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Oct 14, 2026
Contributor
Author
|
thanks @alamb |
Contributor
Contributor
Author
Contributor
|
Guess we'll see...I wasn't sure so I've been merging before re-queuing. Maybe that's not necessary 🤷 Looks like you're right...audit check is passing now. TIL |
This was referenced Oct 18, 2026
[59_maintenance] fix: account for offsets in runarrays when using extend for MutableArrayData
#11671
Merged
Jefffrey
added a commit
that referenced
this pull request
Oct 21, 2026
…end for MutableArrayData (#11671) - Backport #11546 - For inclusion in #11664 Cherry-pick of 2e26ab4 --------- Co-authored-by: Andrew Lamb <[email protected]>
alamb
pushed a commit
that referenced
this pull request
Oct 22, 2026
alamb
pushed a commit
that referenced
this pull request
Oct 22, 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.
Which issue does this PR close?
None
Rationale for this change
Correctness edge case when using RunArrays in MutableArrayData
What changes are included in this PR?
ArrayDataoffset of RunArrays when extendingMutableArrayDataAre these changes tested?
Yes
Are there any significant user-facing changes?
No