JingsongLi commented on a change in pull request #8920: [FLINK-13024][table]
integrate FunctionCatalog with CatalogManager
URL: https://github.com/apache/flink/pull/8920#discussion_r302397256
##########
File path:
flink-table/flink-table-api-java/src/main/java/org/apache/flink/table/catalog/FunctionCatalog.java
##########
@@ -34,26 +36,28 @@
import org.apache.flink.table.functions.UserDefinedAggregateFunction;
import org.apache.flink.table.functions.UserFunctionsTypeHelper;
+import java.util.ArrayList;
import java.util.LinkedHashMap;
+import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Function;
+import java.util.stream.Collectors;
/**
- * Simple function catalog to store {@link FunctionDefinition}s in memory.
+ * Simple function catalog to store {@link FunctionDefinition}s in catalogs.
*/
@Internal
public class FunctionCatalog implements FunctionLookup {
- private final String defaultCatalogName;
-
- private final String defaultDatabaseName;
+ private final CatalogManager catalogManager;
+ // For simplicity, currently hold registered Flink functions in memory
here
+ // TODO: should move to catalog
private final Map<String, FunctionDefinition> userFunctions = new
LinkedHashMap<>();
- public FunctionCatalog(String defaultCatalogName, String
defaultDatabaseName) {
- this.defaultCatalogName = defaultCatalogName;
- this.defaultDatabaseName = defaultDatabaseName;
+ public FunctionCatalog(CatalogManager catalogManager) {
+ this.catalogManager = catalogManager;
Review comment:
checkNotNull?
----------------------------------------------------------------
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