Anthrino commented on code in PR #3677:
URL: https://github.com/apache/calcite/pull/3677#discussion_r1554338431
##########
core/src/main/java/org/apache/calcite/sql/fun/SqlCastFunction.java:
##########
@@ -191,12 +194,12 @@ private static RelDataType
createTypeWithNullabilityFromExpr(RelDataTypeFactory
}
@Override public String getSignatureTemplate(final int operandsCount) {
- assert operandsCount == 2;
- return "{0}({1} AS {2})";
+ assert operandsCount <= 3;
+ return "{0}({1} AS {2} [FORMAT {3}])";
}
@Override public SqlOperandCountRange getOperandCountRange() {
- return SqlOperandCountRanges.of(2);
+ return SqlOperandCountRanges.between(2, 3);
Review Comment:
I think that override is required in every function implementation to
specify the number of operands being passed, it was already existing with a
count = 2 just updated that to be 2 or 3.
Removing that does fail a number of tests and breaks the build, it throws
the `Util.needToImplement` exception from the super as `operandTypeChecker` is
not defined and we need an override.
--
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]