mihaibudiu commented on code in PR #4577:
URL: https://github.com/apache/calcite/pull/4577#discussion_r2426864842


##########
core/src/main/java/org/apache/calcite/sql/SqlBasicFunction.java:
##########
@@ -180,35 +195,40 @@ public static SqlBasicFunction create(String name,
     return dynamic;
   }
 
+  @Override public boolean isIdempotent() {
+    return idempotent;
+  }
+
   /** Returns a copy of this function with a given name. */
   public SqlBasicFunction withName(String name) {
     return new SqlBasicFunction(name, kind, syntax, deterministic,
         getReturnTypeInference(), getOperandTypeInference(), operandHandler,
         getOperandTypeChecker(), callValidator,
-        getFunctionType(), monotonicityInference, dynamic);
+        getFunctionType(), monotonicityInference, dynamic, idempotent);

Review Comment:
   why not keep the constructor version with a default value of 'false' for 
this argument?
   One alternative is to define a new `enum { IDEMPOTENT, NONIDEMPOTENT }` 
instead of using boolean.



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