hackergin commented on code in PR #24106:
URL: https://github.com/apache/flink/pull/24106#discussion_r1466053011


##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/extraction/FunctionTemplate.java:
##########
@@ -173,18 +183,47 @@ private static <T, H extends Annotation> T defaultAsNull(
 
     private static @Nullable FunctionSignatureTemplate createSignatureTemplate(
             DataTypeFactory typeFactory,
-            @Nullable DataTypeHint[] input,
+            @Nullable DataTypeHint[] inputs,
             @Nullable String[] argumentNames,
+            @Nullable ArgumentHint[] argumentHints,
             boolean isVarArg) {
-        if (input == null) {
+
+        String[] argumentHintNames;
+        DataTypeHint[] argumentHintTypes;
+
+        if (argumentHints != null && inputs != null) {
+            throw extractionError(
+                    "Argument and input hints cannot be declared in the same 
function hint.");
+        }
+
+        if (argumentHints != null) {
+            argumentHintNames = new String[argumentHints.length];
+            argumentHintTypes = new DataTypeHint[argumentHints.length];
+            for (int i = 0; i < argumentHints.length; i++) {
+                ArgumentHint argumentHint = argumentHints[i];
+                argumentHintNames[i] = defaultAsNull(argumentHint, 
ArgumentHint::name);
+                argumentHintTypes[i] = defaultAsNull(argumentHint, 
ArgumentHint::type);
+                if (argumentHintNames[i] == null || argumentHintTypes[i] == 
null) {
+                    throw extractionError(

Review Comment:
   Updated, the current logic is that the argument name must be either all set 
or all not set.



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