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_r333868804
 
 

 ##########
 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:
   this changes the method's complexity from `O(1)` to `O(n)`  - and its called 
very frequently - I'm afraid if we have to add this check here: we have to 
start looking for some other options...
   
   I don't see any tests falling when I remove this...do you have a case which 
proves that this change is neccessary?

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


With regards,
Apache Git Services

Reply via email to