hackergin commented on code in PR #24183:
URL: https://github.com/apache/flink/pull/24183#discussion_r1468765647
##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/inference/TypeInferenceOperandChecker.java:
##########
@@ -116,7 +127,17 @@ public Consistency getConsistency() {
@Override
public boolean isOptional(int i) {
- return false;
+ Optional<List<Boolean>> optionalArguments =
typeInference.getOptionalArguments();
+ if (optionalArguments.isPresent()) {
+ return optionalArguments.get().get(i);
+ } else {
+ return false;
+ }
+ }
+
+ @Override
+ public boolean isFixedParameters() {
+ return typeInference.getTypedArguments().isPresent();
Review Comment:
After testing, direct modification here may have an impact on the
verification of existing functions. The original default is false. If most
functions are set to true, it may have an impact on the existing function
detection type verification. Currently, there are two situations, one is the
implicit conversion of timestamp(3) and timestamp(6), and the other is the
conversion of Pojo and RowType. Therefore, I currently change it to return true
only if the optional hint is declared and there is an optional argument
parameter. Otherwise, the default is false, so that the parameter verification
inside the calcite framework can be skipped.
There is failed ci link:
https://dev.azure.com/apache-flink/apache-flink/_build/results?buildId=57012&view=logs&j=0c940707-2659-5648-cbe6-a1ad63045f0a&t=075c2716-8010-5565-fe08-3c4bb45824a4
--
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]