macroguo-ghy commented on code in PR #3416:
URL: https://github.com/apache/calcite/pull/3416#discussion_r1334065232
##########
core/src/main/java/org/apache/calcite/rex/RexSimplify.java:
##########
@@ -2060,6 +2060,25 @@ private RexNode simplifyOrs(List<RexNode> terms,
RexUnknownAs unknownAs) {
}
}
break;
+ case IS_NOT_TRUE:
+ if (terms.contains(((RexCall) term).getOperands().get(0))) {
+ return trueLiteral;
Review Comment:
Yes, you are correct. In programming languages, the evaluation of `||`
follows a left-to-right order. However, in SQL, we need to check all items in
the OR condition. So I say it is "a little different".
And I mentioned a terminology [`Short-circuit
OR`](https://chortle.ccsu.edu/java5/Notes/chap40/ch40_8.html), which means if
the first condition evaluates to true, the subsequent conditions are not
evaluated because the overall result of the OR operation is already determined
to be true.
So I think we are consistent in how programming languages simplify `ORs` :)
--
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]