ctsk commented on code in PR #7773:
URL: https://github.com/apache/arrow-rs/pull/7773#discussion_r2167647225
##########
arrow-array/src/array/byte_view_array.rs:
##########
@@ -734,12 +743,20 @@ where
}
impl<T: ByteViewType + ?Sized> From<GenericByteViewArray<T>> for ArrayData {
- fn from(mut array: GenericByteViewArray<T>) -> Self {
+ fn from(array: GenericByteViewArray<T>) -> Self {
let len = array.len();
- array.buffers.insert(0, array.views.into_inner());
+ let new_buffers = {
+ let mut buffers = Vec::with_capacity(array.buffers.len() + 1);
+ buffers.push(array.views.into_inner());
+ for buffer in array.buffers.iter() {
+ buffers.push(buffer.clone());
+ }
Review Comment:
This worked when the internal representation was a Vec<Buffer>, but doesn't
work anymore when we switch to Arc<[Buffer]> -- other batches might hold a
reference to this buffer array now too.
--
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]