vlsi commented on a change in pull request #1703: [CALCITE-2450] Normalize
RexCall predicates when computing digest
URL: https://github.com/apache/calcite/pull/1703#discussion_r364797191
##########
File path: core/src/main/java/org/apache/calcite/rex/RexCall.java
##########
@@ -73,6 +85,23 @@
SIMPLE_BINARY_OPS = Sets.immutableEnumSet(kinds);
}
+ private static final Set<SqlKind> SIMPLE_COMMUTATIVE_OPS;
+
+ static {
+ SIMPLE_COMMUTATIVE_OPS = Sets.immutableEnumSet(
+ SqlKind.AND, SqlKind.OR, SqlKind.PLUS, SqlKind.TIMES, SqlKind.EQUALS,
SqlKind.NOT_EQUALS,
+ SqlKind.IS_DISTINCT_FROM, SqlKind.IS_NOT_DISTINCT_FROM,
+ SqlKind.GREATEST, SqlKind.LEAST);
Review comment:
Moved to `SqlKind#SYMMETRICAL` and `SqlKind#SYMMETRICAL_SAME_ARG_TYPE`
(which is for cases like `PLUS`, and `TIMES` which can be re-arranged only in
case the argument types are the same).
In other words, timestamp + interval vs interval + timestamp are different
expressions.
----------------------------------------------------------------
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