tustvold commented on code in PR #5602:
URL: https://github.com/apache/arrow-rs/pull/5602#discussion_r1557342324


##########
arrow-select/src/take.rs:
##########
@@ -437,6 +443,20 @@ fn take_bytes<T: ByteArrayType, IndexType: 
ArrowPrimitiveType>(
     Ok(GenericByteArray::from(array_data))
 }
 
+/// `take` implementation for byte view arrays
+fn take_byte_view<T: ByteViewType, IndexType: ArrowPrimitiveType>(
+    array: &GenericByteViewArray<T>,
+    indices: &PrimitiveArray<IndexType>,
+) -> Result<GenericByteViewArray<T>, ArrowError> {
+    let new_views = take_native(array.views(), indices);
+    let new_nulls = take_nulls(array.nulls(), indices);

Review Comment:
   It's beautiful how these traits just magically work



##########
arrow-array/src/cast.rs:
##########
@@ -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 {

Review Comment:
   This is not a breaking change as the trait is sealed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to