xuefuz commented on a change in pull request #9822: [FLINK-14216][table] 
introduce temp system functions to FunctionCatalog
URL: https://github.com/apache/flink/pull/9822#discussion_r331333915
 
 

 ##########
 File path: 
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/catalog/FunctionCatalog.java
 ##########
 @@ -128,12 +127,71 @@ public void registerScalarFunction(String name, 
ScalarFunction function) {
                        throw new TableException("Unknown function class: " + 
function.getClass());
                }
 
-               registerFunction(
+               registerTempSystemFunction(
                        name,
                        definition
                );
        }
 
+       public void registerTempCatalogScalarFunction(ObjectIdentifier oi, 
ScalarFunction function) {
+               
UserFunctionsTypeHelper.validateInstantiation(function.getClass());
+               registerTempCatalogFunction(
+                       oi,
+                       new ScalarFunctionDefinition(oi.getObjectName(), 
function)
+               );
+       }
+
+       public <T> void registerTempCatalogTableFunction(
+               ObjectIdentifier oi,
+               TableFunction<T> function,
+               TypeInformation<T> resultType) {
+               // check if class not Scala object
+               
UserFunctionsTypeHelper.validateNotSingleton(function.getClass());
+               // check if class could be instantiated
+               
UserFunctionsTypeHelper.validateInstantiation(function.getClass());
+
+               registerTempCatalogFunction(
+                       oi,
+                       new TableFunctionDefinition(
+                               oi.getObjectName(),
+                               function,
+                               resultType)
+               );
+       }
+
+       public <T, ACC> void registerTempCatalogAggregateFunction(
+               ObjectIdentifier oi,
+               UserDefinedAggregateFunction<T, ACC> function,
+               TypeInformation<T> resultType,
+               TypeInformation<ACC> accType) {
 
 Review comment:
   Same as above.

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to