-
Notifications
You must be signed in to change notification settings - Fork 881
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 StringArray
/BinaryArray
--> StringView
/ BinaryView
#5686
Conversation
50f7b36
to
4c5105b
Compare
GenericByteArray
to ByteArrayView
GenericByteArray
to ByteArrayView
StringArray
/BinaryArray
--> StringView
/ BinaryView
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this contribution @RinChanNOWWW -- other than using GenericByteViewArray::new_unchecked
I think this PR looks wonderful.
I also think we could also merge the PR as is and then switch to new-unchecked in a follow on PR
let value_buf = &str_values_buf[offset as usize..end as usize]; | ||
let length = end - offset; | ||
|
||
if length <= 12 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As an aside (not for this PR) it would be great to somehow encapsulate this logic into a struct to avoid having to copy the same pattern it so many times. I took a shot at this here #5619
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new enum View
looks good to me.
Thanks @RinChanNOWWW -- I took the liberty of adding a comment to the code in this PR justifying why the unsafe was ok and plan to merge the PR when complete |
🚀 |
Which issue does this PR close?
Part of #5508.
Casting byte view array to byte array and casting between dictionary array and byte view array will be done in other PRs.
Rationale for this change
What changes are included in this PR?
Support casting from byte array (
BinaryArray
,StringArray
) to byte view array (BinaryViewArray
,StringVIewArray
).Are there any user-facing changes?
No.