acking-you commented on code in PR #15462: URL: https://github.com/apache/datafusion/pull/15462#discussion_r2031035548
########## datafusion/physical-expr/src/expressions/binary.rs: ########## @@ -805,6 +811,47 @@ impl BinaryExpr { } } +/// Check if it meets the short-circuit condition +/// 1. For the `AND` operator, if the `lhs` result all are `false` +/// 2. For the `OR` operator, if the `lhs` result all are `true` +/// 3. Otherwise, it does not meet the short-circuit condition +fn check_short_circuit(arg: &ColumnarValue, op: &Operator) -> bool { Review Comment: > I might be missing some obvious points, but > > 1. applying the same check for rhs is redundant? (does it approximately requires the same computation if we continue the execution as is) > 2. why aren't we also covering the cases when **lhs is all true and op is AND** / **lhs is all false and op is OR** I've optimized the comments, so it may look a bit clearer. -- 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