cetra3 commented on code in PR #11281:
URL: https://github.com/apache/arrow-rs/pull/11281#discussion_r4131804800
##########
arrow-select/src/interleave.rs:
##########
@@ -314,8 +317,17 @@ fn interleave_views<T: ByteViewType>(
offsets.push(total_buffers);
}
+ // Marks a buffer in `buffer_to_new_index` that has not yet been
referenced.
+ //
+ // The view's buffer index is a signed 32-bit integer in the Arrow
specification,
+ // so `u32::MAX` can never be a valid buffer index
+ const UNASSIGNED: u32 = u32::MAX;
+
// contains the mapping from old buffer index to new buffer index
- let mut buffer_to_new_index = vec![None; total_buffers];
+ let mut buffer_to_new_index = vec![UNASSIGNED; total_buffers];
Review Comment:
This was left over from a bit of churn. I tried about 5 different approaches
to get this shape.
However, this does add a speed bump, since an `Option<u32>` is 8 bytes vs 4
--
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]