luoyuxia commented on code in PR #22904:
URL: https://github.com/apache/flink/pull/22904#discussion_r1250482173


##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/extraction/TypeInferenceExtractor.java:
##########
@@ -143,6 +145,27 @@ public static TypeInference forAsyncTableFunction(
         return extractTypeInference(mappingExtractor);
     }
 
+    public static TypeInference forProcedure(
+            DataTypeFactory typeFactory, Class<? extends Procedure> procedure) 
{
+        final ProcedureMappingExtractor mappingExtractor =
+                new ProcedureMappingExtractor(
+                        typeFactory,
+                        procedure,
+                        ProcedureDefinition.PROCEDURE_CALL,
+                        
ProcedureMappingExtractor.createParameterSignatureExtraction(1),
+                        
ProcedureMappingExtractor.createReturnTypeResultExtraction(),
+                        
ProcedureMappingExtractor.createParameterAndReturnTypeVerification());
+        try {
+            return extractTypeInferenceOrError(mappingExtractor);
+        } catch (Throwable t) {
+            throw extractionError(
+                    t,
+                    "Could not extract a valid type inference for procedure 
class '%s'. "
+                            + "Please check for implementation mistakes and/or 
provide a corresponding hint.",
+                    mappingExtractor.getFunctionClass().getName());
+        }
+    }

Review Comment:
   Good suggestion.



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