hannerwang commented on code in PR #4078:
URL: https://github.com/apache/calcite/pull/4078#discussion_r1874510648
##########
core/src/main/java/org/apache/calcite/plan/SubstitutionVisitor.java:
##########
@@ -322,7 +325,9 @@ void register(MutableRel result, MutableRel query) {
ImmutableList.of(condition2, target2));
RexNode r =
canonizeNode(rexBuilder, simplify.simplifyUnknownAsFalse(x2));
- if (!r.isAlwaysFalse() && isEquivalent(condition2, r)) {
+ RexNode simplifiedCond2 =
+ canonizeNode(rexBuilder,
simplify.simplifyUnknownAsFalse(condition2));
+ if (!r.isAlwaysFalse() && isEquivalent(simplifiedCond2, r)) {
Review Comment:
Hello @asolimando ,
I attempted to change simplifyUnknownAsFalse to simplify, but I encountered
some issues.
For instance, with the expression `x >= 5 and x > 5`, the simplify method
does not reduce it, whereas simplifyUnknownAsFalse simplifies it to` x > 5`.
Additionally, expressions like` x > 5 and x < 3` are simplified to `x <> x`
when UNKNOWN is treated as UNKNOWN, and to `false` when UNKNOWN is treated as
FALSE.
Therefore, we cannot simply replace simplifyUnknownAsFalse with simplify, as
it would cause many tests to fail.
--
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]