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


##########
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:
   @rubenada Indeed, using a boolean type aligns with the current design, which 
is why I used a boolean type in the first version. Using an enum type does 
break this pattern, but it more clearly indicates whether it is idempotent or 
non-idempotent. Since I have created a Jira ticket to refactor this boolean 
value, both approaches seem less critical at this point. I have two solutions: 
one is to complete the refactoring work in that Jira ticket first and then 
finish this PR. The other is, if @mihaibudiu  agrees to revert to using a 
boolean type, I can also roll back the code and complete this PR first.



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