twalthr commented on code in PR #25972:
URL: https://github.com/apache/flink/pull/25972#discussion_r1914547457
##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/bridging/BridgingSqlFunction.java:
##########
@@ -279,5 +279,15 @@ public SqlReturnTypeInference getRowTypeInference() {
}
return TableCharacteristic.builder(semantics).build();
}
+
+ @Override
+ public boolean argumentMustBeScalar(int ordinal) {
+ final List<StaticArgument> args =
typeInference.getStaticArguments().orElse(null);
+ if (args == null || ordinal >= args.size()) {
+ return true;
+ }
+ final StaticArgument arg = args.get(ordinal);
+ return !arg.is(StaticArgumentTrait.TABLE);
Review Comment:
> adding a new value could unintentionally break something in future
I'm already using a conservative approach here by not testing for for
SCALAR. If you take a look at the default implementation in the super class, it
is also `true` by default. So only TABLE args will set this to something else.
##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/bridging/BridgingSqlFunction.java:
##########
@@ -279,5 +279,15 @@ public SqlReturnTypeInference getRowTypeInference() {
}
return TableCharacteristic.builder(semantics).build();
}
+
+ @Override
+ public boolean argumentMustBeScalar(int ordinal) {
+ final List<StaticArgument> args =
typeInference.getStaticArguments().orElse(null);
+ if (args == null || ordinal >= args.size()) {
+ return true;
+ }
+ final StaticArgument arg = args.get(ordinal);
+ return !arg.is(StaticArgumentTrait.TABLE);
Review Comment:
> adding a new value could unintentionally break something in future
I'm already using a conservative approach here by not testing for for
SCALAR. If you take a look at the default implementation in the super class, it
is also `true` by default. So only TABLE args will set this to something else.
--
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]