Skip to content

Support casting StringView/BinaryView --> StringArray/BinaryArray. #5704

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
May 6, 2024

Conversation

RinChanNOWWW
Copy link
Contributor

@RinChanNOWWW RinChanNOWWW commented May 1, 2024

Which issue does this PR close?

Part of #5508.

Rationale for this change

What changes are included in this PR?

Support casting from byte view array (BinaryViewArray, StringVIewArray) to byte array (BinaryArray, StringArray).

Are there any user-facing changes?

No.

@github-actions github-actions bot added the arrow Changes to the arrow crate label May 1, 2024
@RinChanNOWWW
Copy link
Contributor Author

I have written some of my thoughts in #5508.

@alamb
Copy link
Contributor

alamb commented May 6, 2024

Archery test is failing due to #5719

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Looks great to me -- thank you @RinChanNOWWW 🙏

let mut byte_array_builder = GenericByteBuilder::<TO>::with_capacity(len, bytes);

for val in view_array.iter() {
byte_array_builder.append_option(val);
Copy link
Contributor

Choose a reason for hiding this comment

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

I suspect we could potentially make this code faster by special casing when there are no nulls

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
arrow Changes to the arrow crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants