alamb commented on code in PR #11693:
URL: https://github.com/apache/datafusion/pull/11693#discussion_r1695999958
##########
datafusion/optimizer/src/eliminate_cross_join.rs:
##########
@@ -402,7 +400,18 @@ fn remove_join_expressions(expr: Expr, join_keys:
&JoinKeySet) -> Option<Expr> {
_ => None,
}
}
-
+ Expr::BinaryExpr(BinaryExpr { left, op, right }) if op == Operator::Or
=> {
+ let l = remove_join_expressions(*left, join_keys);
+ let r = remove_join_expressions(*right, join_keys);
+ match (l, r) {
+ (Some(ll), Some(rr)) => Some(Expr::BinaryExpr(BinaryExpr::new(
+ Box::new(ll),
+ op,
+ Box::new(rr),
+ ))),
+ _ => None,
Review Comment:
That might be useful to encode as a comment:
```suggestion
// When either `left` or `right` is empty, it means they are
`true`
// so OR'ing anything with them will also be true
_ => None,
```
--
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]