danny0405 commented on a change in pull request #1610: [CALCITE-3525] 
RexSimplify: eliminate redundant rex calls in OR
URL: https://github.com/apache/calcite/pull/1610#discussion_r358037794
 
 

 ##########
 File path: core/src/main/java/org/apache/calcite/rex/RexSimplify.java
 ##########
 @@ -2210,7 +2210,8 @@ private Comparison(RexNode ref, SqlKind kind, RexLiteral 
literal) {
     /** Creates a comparison, between a {@link RexInputRef} or {@link 
RexFieldAccess}
      * and a literal. */
     static Comparison of(RexNode e) {
-      return of(e, node -> RexUtil.isReferenceOrAccess(node, true));
+      return of(e, node -> RexUtil.isReferenceOrAccess(node, true)
+          || RexUtil.isDeterministic(node));
 
 Review comment:
   This is the core change of this PR, while the others are code refactoring, i 
would suggest to split the PR into 2 commits, one is for this change, and the 
other for the code refactoring.

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