jhorstmann commented on a change in pull request #8204:
URL: https://github.com/apache/arrow/pull/8204#discussion_r490853068
##########
File path: rust/arrow/src/compute/kernels/filter.rs
##########
@@ -241,11 +241,21 @@ impl FilterContext {
let filter_mask: Vec<u64> = (0..64).map(|x| 1u64 << x).collect();
let filter_bytes = filter_array.data_ref().buffers()[0].data();
let filtered_count = bit_util::count_set_bits(filter_bytes);
+
// transmute filter_bytes to &[u64]
let mut u64_buffer = MutableBuffer::new(filter_bytes.len());
- u64_buffer
- .write_bytes(filter_bytes, u64_buffer.capacity() -
filter_bytes.len())?;
- let filter_u64 = u64_buffer.typed_data_mut::<u64>().to_owned();
+ // add to the resulting len so is is a multiple of the size of u64
+ let pad_addional_len = 8 - filter_bytes.len() % 8;
Review comment:
The previous code padded to a multiple of 64 bytes which does not seem
necessary and makes masking of the last element more difficult.
----------------------------------------------------------------
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]