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

Add an API to append view by u128 in for view_builder #6291

Closed
wants to merge 1 commit into from

Conversation

Kev1n8
Copy link
Contributor

@Kev1n8 Kev1n8 commented Aug 23, 2024

Which issue does this PR close?

None

Rationale for this change

The idea is to make the builder a way to append a view by a given u128 (unchecked). Check out this comment.

What changes are included in this PR?

A function is added to the view builder.

Are there any user-facing changes?

no

@github-actions github-actions bot added the arrow Changes to the arrow crate label Aug 23, 2024
@Kev1n8 Kev1n8 changed the title Add a api to append view by u128 in for view_builder Add an API to append view by u128 in for view_builder Aug 23, 2024
/// must be within the bounds of the block
/// (3) The data in the block must be valid type `T`
/// (4) The view must be not null
pub unsafe fn append_view_u128_unchecked(&mut self, view: u128) {
Copy link
Contributor

Choose a reason for hiding this comment

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

If appending raw u128 what is the benefit of using the builder at all, as opposed to just using a Vec<u128> directly? Is the intended use-case to intermix this method with some of the others?

Copy link
Contributor Author

@Kev1n8 Kev1n8 Aug 23, 2024

Choose a reason for hiding this comment

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

That's a good point. However, I believe that StringViewArray does not currently provide a From<Vec<u128>> trait directly. The related PR is intended to manually modify views to obtain the substr_view, which can then be added to the builder. Additionally, since the core implementation of StringView is based on the builder pattern, it seemed natural to me to use it.

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 Author

Choose a reason for hiding this comment

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

I see. That's useful. Thanks.

@Kev1n8 Kev1n8 closed this Aug 23, 2024
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.

2 participants