You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by GitBox <gi...@apache.org> on 2019/07/19 16:06:43 UTC

[GitHub] [calcite] rubenada commented on a change in pull request #1322: [CALCITE-3198] ReduceExpressionsRule.FILTER_INSTANCE does not reduce 'NOT(x=a AND x=b)'

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


With regards,
Apache Git Services