NobiGo commented on code in PR #4078:
URL: https://github.com/apache/calcite/pull/4078#discussion_r1879849858


##########
core/src/main/java/org/apache/calcite/plan/SubstitutionVisitor.java:
##########
@@ -297,8 +297,11 @@ void register(MutableRel result, MutableRel query) {
       RexNode condition, RexNode target) {
     final RexBuilder rexBuilder = simplify.rexBuilder;
     condition = simplify.simplify(condition);
-    target = simplify.simplify(target);
     RexNode condition2 = canonizeNode(rexBuilder, condition);
+    if (target.isAlwaysTrue()) {
+      return condition2;
+    }
+    target = simplify.simplify(target);

Review Comment:
   Can this target be 'true' after simplifying? Do we need to handle when the 
target is always 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to