kgyrtkirk commented on a change in pull request #1116: [CALCITE-2929] 
Simplification of IS NULL checks are incorrectly assum…
URL: https://github.com/apache/calcite/pull/1116#discussion_r267374035
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/rex/RexSimplify.java
 ##########
 @@ -708,12 +708,15 @@ private RexNode simplifyIs2(SqlKind kind, RexNode a, 
RexUnknownAs unknownAs) {
   }
 
   private RexNode simplifyIsNotNull(RexNode a) {
-    if (!a.getType().isNullable()) {
+    if (!a.getType().isNullable() && isSafeExpression(a)) {
       return rexBuilder.makeLiteral(true);
     }
     if (predicates.pulledUpPredicates.contains(a)) {
 
 Review comment:
   I think if its a pulledup predicate - then that means it is already 
evaluated somewhere else as well

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