ibzib commented on a change in pull request #14464:
URL: https://github.com/apache/beam/pull/14464#discussion_r610178548



##########
File path: 
sdks/java/extensions/sql/zetasql/src/main/java/org/apache/beam/sdk/extensions/sql/zetasql/BeamZetaSqlCatalog.java
##########
@@ -156,6 +159,48 @@ void addFunction(ResolvedNodes.ResolvedCreateFunctionStmt 
createFunctionStmt) {
             ImmutableList.of(createFunctionStmt.getSignature())));
   }
 
+  void validateJavaUdf(ResolvedNodes.ResolvedCreateFunctionStmt 
createFunctionStmt) {
+    for (FunctionArgumentType argumentType :
+        createFunctionStmt.getSignature().getFunctionArgumentList()) {
+      Type type = argumentType.getType();
+      if (type == null) {
+        throw new UnsupportedOperationException("UDF templated argument types 
are not supported.");
+      }
+      validateJavaUdfZetaSqlType(type);
+    }
+    if (createFunctionStmt.getReturnType() == null) {
+      throw new NullPointerException("UDF return type must not be null.");

Review comment:
       I also made a PR to add the test I wrote to verify this: #14484




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to