luoyuxia commented on a change in pull request #17761:
URL: https://github.com/apache/flink/pull/17761#discussion_r756082118
##########
File path:
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/catalog/FunctionCatalog.java
##########
@@ -641,7 +641,8 @@ private void validateAndPrepareFunction(CatalogFunction
function)
FunctionDefinition definition = ((InlineCatalogFunction)
function).getDefinition();
UserDefinedFunctionHelper.prepareInstance(config,
(UserDefinedFunction) definition);
- } else if (function.getFunctionLanguage() == FunctionLanguage.JAVA) {
+ } else if (function.getFunctionLanguage() == FunctionLanguage.JAVA
+ && !(function instanceof InlineCatalogFunction)) {
Review comment:
could you explain why add the code `!(function instanceof
InlineCatalogFunction)`?
I guess you want to skip the validation?
But from the comments:
> If the input is instance of `ScalarFunctionDefinition`,
`TableFunctionDefinition` and so on, it means it uses the old type inference.
We assume that they have been validated before being wrapped.
We may skip it when it's TableFunctionDefinition
##########
File path:
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/catalog/FunctionCatalog.java
##########
@@ -641,7 +641,8 @@ private void validateAndPrepareFunction(CatalogFunction
function)
FunctionDefinition definition = ((InlineCatalogFunction)
function).getDefinition();
UserDefinedFunctionHelper.prepareInstance(config,
(UserDefinedFunction) definition);
- } else if (function.getFunctionLanguage() == FunctionLanguage.JAVA) {
+ } else if (function.getFunctionLanguage() == FunctionLanguage.JAVA
+ && !(function instanceof InlineCatalogFunction)) {
Review comment:
could you explain why add the code `!(function instanceof
InlineCatalogFunction)`?
I guess you want to skip the validation?
But from the comments:
> If the input is instance of `ScalarFunctionDefinition`,
`TableFunctionDefinition` and so on, it means it uses the old type inference.
We assume that they have been validated before being wrapped.
We may skip it when it's TableFunctionDefinition
##########
File path:
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/catalog/FunctionCatalog.java
##########
@@ -641,7 +641,8 @@ private void validateAndPrepareFunction(CatalogFunction
function)
FunctionDefinition definition = ((InlineCatalogFunction)
function).getDefinition();
UserDefinedFunctionHelper.prepareInstance(config,
(UserDefinedFunction) definition);
- } else if (function.getFunctionLanguage() == FunctionLanguage.JAVA) {
+ } else if (function.getFunctionLanguage() == FunctionLanguage.JAVA
+ && !(function instanceof InlineCatalogFunction)) {
Review comment:
could you explain why add the code `!(function instanceof
InlineCatalogFunction)`?
I guess you want to skip the validation?
But from the above comments:
> If the input is instance of `ScalarFunctionDefinition`,
`TableFunctionDefinition` and so on, it means it uses the old type inference.
We assume that they have been validated before being wrapped.
We may skip it when it's TableFunctionDefinition
--
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]