Dandandan commented on code in PR #22580:
URL: https://github.com/apache/datafusion/pull/22580#discussion_r3315931125
##########
datafusion/physical-expr/src/expressions/binary.rs:
##########
@@ -905,36 +961,32 @@ fn check_short_circuit<'a>(
return ShortCircuitStrategy::None;
}
- let true_count = bool_array.values().count_set_bits();
+ let values = bool_array.values();
if is_and {
// For AND, prioritize checking for all-false (short
circuit case)
- // Uses optimized false_count() method provided by Arrow
-
- // Short circuit if all values are false
- if true_count == 0 {
+ // Early exit: check if any bit is set without full
popcount
+ if !any_bit_set(values, len) {
Review Comment:
This can use
https://arrow.apache.org/rust/arrow/array/struct.BooleanArray.html#method.has_true
or
https://arrow.apache.org/rust/arrow/array/struct.BooleanArray.html#method.has_false
?
--
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]