alamb commented on code in PR #6939:
URL: https://github.com/apache/arrow-rs/pull/6939#discussion_r1903108998
##########
arrow-buffer/src/bytes.rs:
##########
@@ -28,14 +28,18 @@ use crate::buffer::dangling_ptr;
/// A continuous, fixed-size, immutable memory region that knows how to
de-allocate itself.
///
-/// This structs' API is inspired by the `bytes::Bytes`, but it is not limited
to using rust's
-/// global allocator nor u8 alignment.
+/// Note that this structure is an internal implementation detail of the
Review Comment:
Hopefully this will reduce confusion about `Bytes` (I have also been
confused by the name before too, especially when not in an editor/IDE)
##########
parquet/src/arrow/array_reader/byte_view_array.rs:
##########
@@ -316,9 +316,8 @@ impl ByteViewArrayDecoderPlain {
}
pub fn read(&mut self, output: &mut ViewBuffer, len: usize) ->
Result<usize> {
- // Here we convert `bytes::Bytes` into `arrow_buffer::Bytes`, which is
zero copy
- // Then we convert `arrow_buffer::Bytes` into `arrow_buffer:Buffer`,
which is also zero copy
- let buf = arrow_buffer::Buffer::from_bytes(self.buf.clone().into());
+ // Zero copy convert `bytes::Bytes` into `arrow_buffer:Buffer`
+ let buf = arrow_buffer::Buffer::from(self.buf.clone());
Review Comment:
Change to use the From impls
--
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]