xuefuz commented on a change in pull request #9979: [FLINK-14417][table]
Develop CoreModule to provide Flink built-in functions
URL: https://github.com/apache/flink/pull/9979#discussion_r338761695
##########
File path:
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/catalog/FunctionCatalog.java
##########
@@ -203,39 +201,40 @@ public void
registerTempCatalogScalarFunction(ObjectIdentifier oi, ScalarFunctio
Set<String> result = getUserDefinedFunctionNames();
// Get built-in functions
- result.addAll(
- BuiltInFunctionDefinitions.getDefinitions()
- .stream()
- .map(f -> normalizeName(f.getName()))
- .collect(Collectors.toSet())
- );
+ result.addAll(moduleManager.listFunctions());
return result.toArray(new String[0]);
}
private Set<String> getUserDefinedFunctionNames() {
Set<String> result = new HashSet<>();
- // Get functions in catalog
+ // add catalog functions
Catalog catalog =
catalogManager.getCatalog(catalogManager.getCurrentCatalog()).get();
try {
result.addAll(catalog.listFunctions(catalogManager.getCurrentDatabase()));
} catch (DatabaseNotExistException e) {
// Ignore since there will always be a current database
of the current catalog
}
- // Get functions registered in memory
+ // add temp system functions
result.addAll(
tempSystemFunctions.values().stream()
.map(FunctionDefinition::toString)
.collect(Collectors.toSet()));
+ // add temp catalog functions
+ result.addAll(
+ tempCatalogFunctions.values().stream()
+ .map(FunctionDefinition::toString)
+ .collect(Collectors.toSet()));
Review comment:
We should probably move this to be the first as it has higher resolution
priority than regular catalog functions.
----------------------------------------------------------------
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