nevi-me commented on a change in pull request #9353: URL: https://github.com/apache/arrow/pull/9353#discussion_r575168065
########## File path: rust/arrow/src/compute/kernels/length.rs ########## @@ -24,42 +24,77 @@ use crate::{ }; use std::sync::Arc; -fn length_string<OffsetSize>(array: &Array, data_type: DataType) -> Result<ArrayRef> -where - OffsetSize: OffsetSizeTrait, -{ - // note: offsets are stored as u8, but they can be interpreted as OffsetSize - let offsets = &array.data_ref().buffers()[0]; - // this is a 30% improvement over iterating over u8s and building OffsetSize, which - // justifies the usage of `unsafe`. - let slice: &[OffsetSize] = - &unsafe { offsets.typed_data::<OffsetSize>() }[array.offset()..]; +fn clone_null_buffer(array: &impl Array) -> Option<Buffer> { + array + .data_ref() + .null_bitmap() Review comment: `.null_buffer().cloned()` ? ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org