ILuffZhe commented on code in PR #4488:
URL: https://github.com/apache/calcite/pull/4488#discussion_r2255843707


##########
core/src/main/java/org/apache/calcite/rex/RexSimplify.java:
##########
@@ -88,6 +88,12 @@ public class RexSimplify {
 
   private static final Strong STRONG = new Strong();
 
+  private static final ImmutableList<SqlOperator> IDEMOTENT_UNARY_FUNCTIONS =

Review Comment:
   Just a little curious, what if someone plan to implement other idemotent 
categories in the future. Does the current design have  good expansibility?
   For UNARY functions, I think it's good overall.



##########
core/src/main/java/org/apache/calcite/rex/RexSimplify.java:
##########
@@ -397,6 +405,22 @@ RexNode isFalse(RexNode e) {
         : rexBuilder.makeCall(SqlStdOperatorTable.IS_FALSE, e);
   }
 
+  /**
+   * Runs simplification unary function by eliminating idempotent.
+   */
+  private RexCall simplifyIdempotentUnaryFunction(RexCall rexCall) {
+    while (IDEMOTENT_UNARY_FUNCTIONS.contains(rexCall.getOperator())

Review Comment:
   Can max(upper(upper(col))) be simplified to max(upper())?



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to