feat(arrow-array): add GenericByteViewArray::total_bytes_len#9641
Open
hcrosse wants to merge 1 commit intoapache:mainfrom
Open
feat(arrow-array): add GenericByteViewArray::total_bytes_len#9641hcrosse wants to merge 1 commit intoapache:mainfrom
hcrosse wants to merge 1 commit intoapache:mainfrom
Conversation
Sums byte lengths of all non-null values, including inlined strings that total_buffer_bytes_used() skips. Closes apache#9435
alamb
approved these changes
Apr 1, 2026
|
🎉 Awesome, thank you @hcrosse ! |
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
total_buffer_bytes_used()only counts non-inlined strings (> 12 bytes), so it returns 0 for arrays of short strings. This makes it unsuitable as a capacity hint when pre-allocating output buffers (e.g. in DataFusion'sconcat()/concat_ws()).What changes are included in this PR?
Adds
total_bytes_len()toGenericByteViewArray, which sums byte lengths of all non-null values including inlined strings.Are there any user-facing changes?
New public method on
GenericByteViewArray(and by extensionStringViewArray/BinaryViewArray).