fix(arrow-select): fix take output capacity for sliced lists - #11360
Merged
Jefffrey merged 1 commit intoOct 4, 2026
Merged
Conversation
…le values `take` on a List, LargeList or Map estimated the output's child capacity as the average row length times the number of rows taken. It worked out the average from the whole child array, including values outside a slice, so taking rows from a small slice of a large array could reserve far more memory than needed, and the result kept that memory. For example, taking 100 rows from a two-row slice of a 1000-row array of 10-element lists used about 4 MB instead of 8 KB. Work out the average from the child values that the rows use.
Jefffrey
approved these changes
Oct 4, 2026
Contributor
|
thanks @neilconway |
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?
Rationale for this change
takeon a list or map uses the average input row length as part of its estimate for sizing its output buffer. However, it calculated the average row length starting from raw size of the input values buffer, not the visible span. This could result in computing a very large "average row length" for sliced lists and maps, and therefore over-allocating output capacity.What changes are included in this PR?
Are these changes tested?
Yes; existing tests pass, new test added.
Are there any significant user-facing changes?
No.
AI usage
Developed and revised with Claude Code (Opus 5.5), reviewed with Codex.