Dandandan commented on code in PR #7650: URL: https://github.com/apache/arrow-rs/pull/7650#discussion_r2157733581
########## arrow-array/src/array/byte_view_array.rs: ########## @@ -479,6 +479,32 @@ impl<T: ByteViewType + ?Sized> GenericByteViewArray<T> { builder.finish() } + /// Returns the total number of bytes used by all non inlined views in all + /// buffers. + /// + /// Note this does not account for views that point at the same underlying + /// data in buffers + /// + /// For example, if the array has three strings views: + /// * View with length = 9 (inlined) + /// * View with length = 32 (non inlined) + /// * View with length = 16 (non inlined) + /// + /// Then this method would report 48 + pub fn total_buffer_bytes_used(&self) -> usize { + self.views() + .iter() + .map(|v| { + let len = (*v as u32) as usize; + if len > 12 { Review Comment: We probably should set this as constant somewhere and use 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: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org