leonardBang 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_r333886685
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/rex/RexCall.java
 ##########
 @@ -204,7 +204,7 @@ public RelDataType getType() {
     // This reduction allows us to convert it to a semi-join.
     switch (getKind()) {
     case IS_NOT_NULL:
-      return !operands.get(0).getType().isNullable();
+      return RexSimplify.isSafeExpression(this) && 
!operands.get(0).getType().isNullable();
 
 Review comment:
   @kgyrtkirk thanks for review,
    If we don't  change here,  tests RexProgramTest#testSimplifyCondition and 
RexProgramTest#testSimplifyCondition2
   will fail after we change the IS_NOT_NULL behavior in RexSimplify.
   Yes, the piece of code is called really frequently and will have higher 
cost, so I wonder we should add a switch for these change.

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


With regards,
Apache Git Services

Reply via email to