Rich-T-kid commented on code in PR #11055:
URL: https://github.com/apache/arrow-rs/pull/11055#discussion_r3993634367
##########
arrow-select/src/filter.rs:
##########
@@ -684,22 +753,17 @@ fn filter_bits(buffer: &BooleanBuffer, predicate:
&FilterPredicate) -> Buffer {
match &predicate.strategy {
IterationStrategy::IndexIterator => {
- let bits =
- // SAFETY: IndexIterator uses the filter predicate to derive
indices
- IndexIterator::new(&predicate.filter,
predicate.count).map(|src_idx| unsafe {
- bit_util::get_bit_raw(buffer.values().as_ptr(), src_idx +
offset)
- });
-
- // SAFETY: `IndexIterator` reports its size correctly
- unsafe { MutableBuffer::from_trusted_len_iter_bool(bits).into() }
+ gather_bits(buffer, predicate.filter.values(), predicate.count)
}
IterationStrategy::Indices(indices) => {
- // SAFETY: indices were derived from the filter predicate
- let bits = indices.iter().map(|src_idx| unsafe {
- bit_util::get_bit_raw(buffer.values().as_ptr(), *src_idx +
offset)
- });
- // SAFETY: `Vec::iter()` reports its size correctly
Review Comment:
going to add these safety comments back in
--
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]