tustvold commented on code in PR #2646:
URL: https://github.com/apache/arrow-rs/pull/2646#discussion_r962297041
##########
arrow/src/compute/kernels/comparison.rs:
##########
@@ -59,12 +59,30 @@ where
let null_bit_buffer =
combine_option_bitmap(&[left.data_ref(), right.data_ref()],
left.len())?;
- // Safety:
- // `i < $left.len()` and $left.len() == $right.len()
- let comparison = (0..left.len())
- .map(|i| unsafe { op(left.value_unchecked(i),
right.value_unchecked(i)) });
- // same size as $left.len() and $right.len()
- let buffer = unsafe {
MutableBuffer::from_trusted_len_iter_bool(comparison) };
+ let mut buffer = MutableBuffer::new((left.len() + 7) / 8);
+
+ let chunks = left.len() / 8;
Review Comment:
The problem is that LLVM isn't able to elide the conditional due to
Iterator::next, and this prevents it from working correctly. I couldn't find a
way around this
--
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]