Dandandan commented on code in PR #11247: URL: https://github.com/apache/datafusion/pull/11247#discussion_r1667162101
########## datafusion/physical-expr/src/expressions/binary.rs: ########## @@ -257,7 +257,50 @@ impl PhysicalExpr for BinaryExpr { fn evaluate(&self, batch: &RecordBatch) -> Result<ColumnarValue> { use arrow::compute::kernels::numeric::*; + fn check_short_circuit(arg: &ColumnarValue, op: &Operator) -> bool { + let data_type = arg.data_type(); + match (data_type, op) { + (DataType::Boolean, Operator::And) => { + match arg { + ColumnarValue::Array(array) => { + if let Ok(array) = as_boolean_array(&array) { + return array.true_count() == 0; Review Comment: We probably can speed it up by providing a function that doesn't count but provides whether the bitmap is all true / all 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org