Avoid a clone when creating StringArray/BinaryArray from ArrayData#9160
Merged
Dandandan merged 3 commits intoapache:mainfrom Jan 14, 2026
Merged
Avoid a clone when creating StringArray/BinaryArray from ArrayData#9160Dandandan merged 3 commits intoapache:mainfrom
Dandandan merged 3 commits intoapache:mainfrom
Conversation
alamb
commented
Jan 13, 2026
| /// | ||
| /// - buffer must contain valid arrow offsets ( [`OffsetBuffer`] ) for the | ||
| /// given length and offset. | ||
| unsafe fn get_offsets_from_buffer<O: ArrowNativeType>( |
Contributor
Author
There was a problem hiding this comment.
This is a version of get_offsets immediately above here that takes the Buffers rather than ArrayData. Once I have ported all the arrays, I will remove get_offsets
alamb
commented
Jan 13, 2026
| value_data, | ||
| data_type: T::DATA_TYPE, | ||
| nulls: data.nulls().cloned(), | ||
| data_type, |
Contributor
Author
There was a problem hiding this comment.
This also saves calling Drop on DataType and a clone of Nulls -- probably not measurable but faster 🤷
Contributor
There was a problem hiding this comment.
Sometimes a lot of Drop can be surprisingly slow
Jefffrey
approved these changes
Jan 14, 2026
Dandandan
approved these changes
Jan 14, 2026
Dandandan
pushed a commit
to Dandandan/arrow-rs
that referenced
this pull request
Jan 15, 2026
…pache#9160) # Which issue does this PR close? - Part of apache#9061 - broken out of apache#9058 # Rationale for this change Let's make arrow-rs the fastest we can and the fewer allocations the better # What changes are included in this PR? Apply pattern from apache#9114 # Are these changes tested? Existing tests # Are there any user-facing changes? No
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?
make_array) #9061ArrayData(speed up reading from Parquet reader) #9058Rationale for this change
Let's make arrow-rs the fastest we can and the fewer allocations the better
What changes are included in this PR?
Apply pattern from #9114
Are these changes tested?
Existing tests
Are there any user-facing changes?
No