You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2019/10/11 08:02:46 UTC

[GitHub] [calcite] kgyrtkirk commented on a change in pull request #1491: [CALCITE-3368] Some problems simplifying ‘expression IS NULL’

kgyrtkirk commented on a change in pull request #1491: [CALCITE-3368] Some problems simplifying ‘expression IS NULL’ 
URL: https://github.com/apache/calcite/pull/1491#discussion_r333870858
 
 

 ##########
 File path: core/src/test/java/org/apache/calcite/test/RexProgramTest.java
 ##########
 @@ -1266,21 +1268,53 @@ private void checkExponentialCnf(int n) {
 
     // "null is null" to "true"
     checkSimplify(isNull(nullBool), "true");
-    // "(x + y) is null" simplifies to "x is null or y is null"
-    checkSimplify(isNull(plus(vInt(0), vInt(1))),
-        "OR(IS NULL(?0.int0), IS NULL(?0.int1))");
-    checkSimplify(isNull(plus(vInt(0), vIntNotNull(1))), "IS NULL(?0.int0)");
-    checkSimplify(isNull(plus(vIntNotNull(0), vIntNotNull(1))), "false");
-    checkSimplify(isNull(plus(vIntNotNull(0), vInt(1))), "IS NULL(?0.int1)");
-
-    // "(x + y) is not null" simplifies to "x is not null and y is not null"
-    checkSimplify(isNotNull(plus(vInt(0), vInt(1))),
-        "AND(IS NOT NULL(?0.int0), IS NOT NULL(?0.int1))");
-    checkSimplify(isNotNull(plus(vInt(0), vIntNotNull(1))),
-        "IS NOT NULL(?0.int0)");
-    checkSimplify(isNotNull(plus(vIntNotNull(0), vIntNotNull(1))), "true");
-    checkSimplify(isNotNull(plus(vIntNotNull(0), vInt(1))),
-        "IS NOT NULL(?0.int1)");
+  }
+
+
+  @Test public void testUnsafeSimplify() {
 
 Review comment:
   this "test" contains quite a lot of cases...
   
   * if one fails - its harder to start debugging something like this
   * and I also feel that there is some redundancy - we don't really excercise new code paths by changing from `plus` to `minus`...we can have one...

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services