Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

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

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

@alamb alamb merged commit 7568178 into apache:master May 6, 2024
24 of 25 checks passed
@RinChanNOWWW RinChanNOWWW deleted the cast-view-to-byte branch May 9, 2024 01:59
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.

None yet

2 participants