Skip to content

feat: support BinaryView in bit_length kernel#9363

Merged
alamb merged 1 commit intoapache:mainfrom
Abhisheklearn12:feat/support-binaryview-bit-length
Feb 6, 2026
Merged

feat: support BinaryView in bit_length kernel#9363
alamb merged 1 commit intoapache:mainfrom
Abhisheklearn12:feat/support-binaryview-bit-length

Conversation

@Abhisheklearn12
Copy link
Contributor

@Abhisheklearn12 Abhisheklearn12 commented Feb 5, 2026

Which issue does this PR close?

Rationale for this change

The bit_length kernel supports Utf8View but is missing support for BinaryView. This adds parity between string and binary view types.

What changes are included in this PR?

  • Add DataType::BinaryView match arm in bit_length() function
  • Update docstring to reflect supported types
  • Add tests for BinaryView bit_length (with and without nulls)

Are these changes tested?

Yes. Added two tests:

  • bit_length_binary_view - tests basic functionality
  • bit_length_null_binary_view - tests null handling

Are there any user-facing changes?

Yes. bit_length() now accepts BinaryViewArray as input and returns Int32Array containing bit lengths.

@github-actions github-actions bot added the arrow Changes to the arrow crate label Feb 5, 2026
let values = list
.views()
.iter()
.map(|view| (*view as i32).wrapping_mul(8))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do use i32 above for the Utf8View arm so I assume this is being consistent with that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, exactly, I just matched the Utf8View arm above for consistency

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consistency makes sense. I filed a ticket to make the rest of the codebase consistent as a follow on PR

let values = list
.views()
.iter()
.map(|view| (*view as i32).wrapping_mul(8))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do use i32 above for the Utf8View arm so I assume this is being consistent with that

@alamb alamb merged commit 7dbe58a into apache:main Feb 6, 2026
19 checks passed
@alamb
Copy link
Contributor

alamb commented Feb 6, 2026

Thanks @Abhisheklearn12 and @Jefffrey and @Dandandan

@Abhisheklearn12 Abhisheklearn12 deleted the feat/support-binaryview-bit-length branch February 7, 2026 06:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arrow Changes to the arrow crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support BinaryView in bit_length kernel

4 participants