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_r334906162
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/rex/RexSimplify.java
 ##########
 @@ -753,7 +753,10 @@ private RexNode simplifyIsNotNull(RexNode a) {
     case NOT_NULL:
       return rexBuilder.makeLiteral(true);
     case ANY:
-      // "f" is a strong operator, so "f(operand0, operand1) IS NOT NULL"
+      if (!isSafeExpression(a)) {
 
 Review comment:
   I think we need to extend the concept; in this case it asks for wether the 
subtree is safe; however considering:
   ```
   isNotNull(eq(vBool(), gt(plus(vInt(), literal(1)),literal(1))))
   ```
   that's not neccessary...since '=' is Strong.ANY ; we can use the 
distributive rule
   at this point we should only check wether the actual Kind is safe or not

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