You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2019/10/24 20:35:05 UTC

[GitHub] [flink] bowenli86 commented on a change in pull request #9979: [FLINK-14417][table] Develop CoreModule to provide Flink built-in functions

bowenli86 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_r338777772
 
 

 ##########
 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:
   The order shouldn't matter since it only shows a deduped set of names and don't interfere with func resolution. 
   Sorry, this actually has nothing to do with code module and I will revert it. Should be done in a separate PR

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


With regards,
Apache Git Services