Conversation
liamzwbao
force-pushed
the
issue-9298-concat-array-data
branch
from
September 12, 2026 17:33
ed45969 to
db1e53c
Compare
ArrayData with direct Array construction in concatArrayData with direct Array construction in concat
liamzwbao
commented
Sep 12, 2026
Comment on lines
+433
to
+441
| // Reject lengths that do not fit in `R` before any `R::Native` arithmetic can wrap. | ||
| let total_len: usize = run_arrays.iter().map(|r| r.len()).sum(); | ||
| if R::Native::from_usize(total_len).is_none() { | ||
| return Err(ArrowError::ComputeError(format!( | ||
| "Concatenating RunArrays results in a logical length of {total_len}, \ | ||
| which overflows the run-end type {}", | ||
| R::DATA_TYPE | ||
| ))); | ||
| } |
Contributor
Author
There was a problem hiding this comment.
This is necessary to fix the failure reproduced in the UT test_concat_run_array_length_overflows_run_end_type
liamzwbao
force-pushed
the
issue-9298-concat-array-data
branch
from
September 12, 2026 17:46
db1e53c to
3ce2087
Compare
liamzwbao
marked this pull request as ready for review
September 12, 2026 17:46
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?
ArrayDatawith direct Array construction, when possible #9298.Rationale for this change
concat_run_arraysbuilt its result viaRunArray::try_new, which re-validates the run ends on every call even though they're already known-valid here: inputs are validRunArrays, so the adjusted run ends are strictly increasing by construction.What changes are included in this PR?
concat.rs:concat_run_arraysnow builds the result directly viaRunArray::new_unchecked(data_type, RunEndBuffer::new_unchecked(...), values), skippingtry_new's revalidation.concat.rs: adds an explicit overflow guard and rejects up front if the total doesn't fit in the run-end typeR, before anyR::Nativearithmetic runs.nullif.rs/take.rschanges are test-only cleanup.Are these changes tested?
Yes — existing test suite, plus a new regression test for the overflow guard.
Benchmark results
this branch vs
main(RunArray<Int32Type>,narrays concatenated):Are there any user-facing changes?
No.