geoffreyclaude commented on code in PR #23011:
URL: https://github.com/apache/datafusion/pull/23011#discussion_r3453745157
##########
datafusion/physical-expr/src/expressions/in_list/primitive_filter.rs:
##########
@@ -43,9 +44,25 @@ impl UInt8BitmapFilter {
exec_datafusion_err!("UInt8BitmapFilter: expected UInt8 array")
})?;
let mut bits = [0u64; 4];
- for v in prim_array.iter().flatten() {
- let index = v as usize;
+ let mut set_bit = |v: u8| {
+ let index = usize::from(v);
bits[index / 64] |= 1u64 << (index % 64);
+ };
+
+ let values = prim_array.values();
+ match prim_array.nulls() {
+ None => {
+ for &v in values {
Review Comment:
`values.iter().copied().for_each(set_bit)` is shorter, but less legible.
Both should compile the same.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]