rubenada commented on a change in pull request #2253:
URL: https://github.com/apache/calcite/pull/2253#discussion_r534039470



##########
File path: core/src/test/java/org/apache/calcite/rex/RexProgramTest.java
##########
@@ -3159,4 +3160,44 @@ private SqlSpecialOperatorWithPolicy(String name, 
SqlKind kind, int prec, boolea
   @Test void testSimplifyVarbinary() {
     checkSimplifyUnchanged(cast(cast(vInt(), tVarchar(true, 100)), 
tVarbinary(true)));
   }
+
+  @Test public void testEliminateCommonExprInCondition() {
+    RexSimplify rexSimplify = new RexSimplify(rexBuilder, 
RelOptPredicateList.EMPTY, EXECUTOR);
+
+    // (a=b && c=7) || (a=b && c=7 && d=8) => (a=b && c=7)
+    RexNode or1 = or(
+        and(vBool(0), vBool(1)),
+        and(vBool(0), vBool(1), vBool(2))
+    );
+    RexNode orSimplified2 = rexSimplify.eliminateCommonExprInCondition(or1);

Review comment:
       minor: I guess this should be named `orSimplified1` (and the one below 
in line 3182 should be `orSimplified2`)




----------------------------------------------------------------
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.

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


Reply via email to