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_r305713330
##########
File path: core/src/main/java/org/apache/calcite/rex/RexSimplify.java
##########
@@ -1605,6 +1605,8 @@ private void ensureParanoidOff() {
/** Simplifies a list of terms and combines them into an OR.
* Modifies the list in place. */
private RexNode simplifyOrs(List<RexNode> terms, RexUnknownAs unknownAs) {
+ // Auxiliary map to simplify cases like: X <> A OR X <> B => TRUE
+ final Map<RexNode, Comparison> notEqualsComparisonMap = new HashMap<>();
for (int i = 0; i < terms.size(); i++) {
Review comment:
Thanks for you comment @danny0405
I don't quite understand the issue with RexNode `digest`, theoretically this
field should be computed in the constructor ("Effectively final. Set in each
sub-class constructor, and never re-set"). Besides, we must keep in mind that
this map will effectively store just RexInputeRef and RexFieldAccess.
----------------------------------------------------------------
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