alamb commented on a change in pull request #8960:
URL: https://github.com/apache/arrow/pull/8960#discussion_r548510829
##########
File path: rust/arrow/src/array/transform/variable_size.rs
##########
@@ -43,33 +47,33 @@ pub(super) fn build_extend<T: OffsetSizeTrait>(array:
&ArrayData) -> Extend {
// fast case where we can copy regions without null issues
Box::new(
move |mutable: &mut _MutableArrayData, _, start: usize, len:
usize| {
- let mutable_offsets = mutable.buffer::<T>(0);
- let last_offset = mutable_offsets[mutable_offsets.len() - 1];
- // offsets
- let buffer = &mut mutable.buffers[0];
+ let offset_buffer = &mut mutable.buffer1;
+ let values_buffer = &mut mutable.buffer2;
+
+ // this is safe due to how offset is built. See details on
`get_last_offset`
+ let last_offset = unsafe { get_last_offset(offset_buffer) };
Review comment:
Sounds like a good plan to me
----------------------------------------------------------------
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:
[email protected]