scovich commented on code in PR #9114:
URL: https://github.com/apache/arrow-rs/pull/9114#discussion_r2678942188
##########
arrow-array/src/array/byte_view_array.rs:
##########
@@ -967,15 +967,16 @@ impl<'a, T: ByteViewType + ?Sized> IntoIterator for &'a
GenericByteViewArray<T>
}
impl<T: ByteViewType + ?Sized> From<ArrayData> for GenericByteViewArray<T> {
- fn from(value: ArrayData) -> Self {
- let views = value.buffers()[0].clone();
- let views = ScalarBuffer::new(views, value.offset(), value.len());
- let buffers = value.buffers()[1..].to_vec().into();
+ fn from(data: ArrayData) -> Self {
+ let (_data_type, len, nulls, offset, mut buffers, _child_data) =
data.into_parts();
+ let views = buffers.remove(0); // need to maintain order of remaining
buffers
+ let buffers = buffers.into(); // convert to Arc
Review Comment:
I was going to ask the same thing... except for `Arc::new`. Longer than
`.into()` but shorter than having to comment it.
--
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]