rubenada commented on a change in pull request #1322: [CALCITE-3198] 
ReduceExpressionsRule.FILTER_INSTANCE does not reduce 'NOT(x=a AND x=b)'
URL: https://github.com/apache/calcite/pull/1322#discussion_r305424810
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/rex/RexSimplify.java
 ##########
 @@ -1624,6 +1626,24 @@ private RexNode simplifyOrs(List<RexNode> terms, 
RexUnknownAs unknownAs) {
             continue;
           }
         }
+        break;
+      case NOT_EQUALS:
+        Comparison notEqualsComparison =
+            Comparison.of(term, node -> RexUtil.isReferenceOrAccess(node, 
false));
 
 Review comment:
   Theoretically yes, but in practice it does not even work right now in cases 
like:
   `x+y = a AND x+y = b => could be simplified as FALSE, but it is not`
   I think it would be too risky to try to simplify other things than 
ReferenceOrAccess, but I will let other experts in this module to confirm this. 
   So, I'd rather keep this change simple and just enable a simplification for 
the scenario described above.

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