feat: support BinaryView in bit_length kernel#9363
Merged
alamb merged 1 commit intoapache:mainfrom Feb 6, 2026
Merged
Conversation
Dandandan
approved these changes
Feb 5, 2026
alamb
reviewed
Feb 5, 2026
| let values = list | ||
| .views() | ||
| .iter() | ||
| .map(|view| (*view as i32).wrapping_mul(8)) |
Contributor
There was a problem hiding this comment.
I think most other places use u32 (rather than i32) -- for example
Contributor
There was a problem hiding this comment.
We do use i32 above for the Utf8View arm so I assume this is being consistent with that
Contributor
Author
There was a problem hiding this comment.
yep, exactly, I just matched the Utf8View arm above for consistency
Contributor
There was a problem hiding this comment.
Consistency makes sense. I filed a ticket to make the rest of the codebase consistent as a follow on PR
Jefffrey
approved these changes
Feb 6, 2026
| let values = list | ||
| .views() | ||
| .iter() | ||
| .map(|view| (*view as i32).wrapping_mul(8)) |
Contributor
There was a problem hiding this comment.
We do use i32 above for the Utf8View arm so I assume this is being consistent with that
Contributor
|
Thanks @Abhisheklearn12 and @Jefffrey and @Dandandan |
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?
BinaryViewinbit_lengthkernel #9351.Rationale for this change
The
bit_lengthkernel supportsUtf8Viewbut is missing support forBinaryView. This adds parity between string and binary view types.What changes are included in this PR?
DataType::BinaryViewmatch arm inbit_length()functionBinaryViewbit_length (with and without nulls)Are these changes tested?
Yes. Added two tests:
bit_length_binary_view- tests basic functionalitybit_length_null_binary_view- tests null handlingAre there any user-facing changes?
Yes.
bit_length()now acceptsBinaryViewArrayas input and returnsInt32Arraycontaining bit lengths.