xuefuz commented on a change in pull request #8920: [FLINK-13024][table]
integrate FunctionCatalog with CatalogManager
URL: https://github.com/apache/flink/pull/8920#discussion_r302671142
##########
File path:
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/catalog/FunctionCatalog.java
##########
@@ -136,18 +185,19 @@ public void registerScalarFunction(String name,
ScalarFunction function) {
foundDefinition =
BuiltInFunctionDefinitions.getDefinitions()
.stream()
- .filter(f ->
normalizeName(name).equals(normalizeName(f.getName())))
+ .filter(f ->
functionName.equals(normalizeName(f.getName())))
.findFirst()
.map(Function.identity());
}
return foundDefinition.map(definition -> new
FunctionLookup.Result(
- ObjectIdentifier.of(defaultCatalogName,
defaultDatabaseName, name),
+ ObjectIdentifier.of(catalogManager.getCurrentCatalog(),
catalogManager.getCurrentDatabase(), name),
Review comment:
I'm a little confused/concerned about the identifier created here. From
about code it seems that the function can be resolved either in the current
catalog (in catalog manager), in "userFunctions", which might conceptually
belong to default catalog/database (or built-in catalog), or in
BuiltInFunctionDefinitions which doesn't belong to any catalog. As a followup,
we might want to unify userFunctions with built-in catalog and clarify the
resolution process in multiple catalogs.
----------------------------------------------------------------
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]
With regards,
Apache Git Services