rubenada commented on code in PR #4577:
URL: https://github.com/apache/calcite/pull/4577#discussion_r2429218234
##########
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:
IMO a (new) boolean flag makes more sense considering the already existing
flag (deterministic, dynamic). Modifying the constructors is the way to ensure
backwards compatibility and avoid breaking consumers.
Whenever we tackle CALCITE-7224, we could deprecate all the constructors
using the several flags (with the classic "to be removed before 2.0" comment),
and create a single one with a unified flag field.
--
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]