-
Notifications
You must be signed in to change notification settings - Fork 796
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
Implement take
kernel for byte view array.
#5602
Conversation
@@ -779,6 +779,34 @@ pub trait AsArray: private::Sealed { | |||
self.as_bytes_opt().expect("binary array") | |||
} | |||
|
|||
/// Downcast this to a [`StringViewArray`] returning `None` if not possible | |||
fn as_string_view(&self) -> &StringViewArray { |
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.
This is not a breaking change as the trait is sealed
let new_views = take_native(array.views(), indices); | ||
let new_nulls = take_nulls(array.nulls(), indices); |
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.
It's beautiful how these traits just magically work
I took the liberty of switching to use ArrayData equality and renaming the AsArray method to byte_view. Whilst |
Thank you @RinChanNOWWW and @tustvold FYI @ariesdevil and @XiangpengHao -- its happening! |
Which issue does this PR close?
Closes #5511.
Rationale for this change
Necessary feature.
What changes are included in this PR?
take
kernel forStringViewArray
andByteViewArray
.Are there any user-facing changes?
No.