Package org.apache.flink.table.catalog
Class FunctionCatalog
java.lang.Object
org.apache.flink.table.catalog.FunctionCatalog
Simple function catalog to store
FunctionDefinitions in catalogs.
Note: This class can be cleaned up a lot once we drop the methods deprecated as part of
FLIP-65. In the long-term, the class should be a part of catalog manager similar to DataTypeFactory.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe CatalogFunction which holds an instantiated UDF. -
Constructor Summary
ConstructorsConstructorDescriptionFunctionCatalog(org.apache.flink.configuration.ReadableConfig config, ResourceManager resourceManager, CatalogManager catalogManager, ModuleManager moduleManager) -
Method Summary
Modifier and TypeMethodDescriptionCreates aFunctionLookupto thisFunctionCatalog.copy(ResourceManager newResourceManager) booleandropCatalogFunction(org.apache.flink.table.catalog.UnresolvedIdentifier unresolvedIdentifier, boolean ignoreIfNotExist) Drops a catalog function by also considering temporary catalog functions.org.apache.flink.table.catalog.CatalogFunctiondropTempCatalogFunction(org.apache.flink.table.catalog.ObjectIdentifier identifier, boolean ignoreIfNotExist) Drop a temporary catalog function.booleandropTemporaryCatalogFunction(org.apache.flink.table.catalog.UnresolvedIdentifier unresolvedIdentifier, boolean ignoreIfNotExist) Drops a temporary catalog function.booleandropTemporarySystemFunction(String name, boolean ignoreIfNotExist) Drops a temporary system function.String[]Get names of all functions, including temp system functions, system functions, temp catalog functions and catalog functions in the current catalog and current database.String[]getFunctions(String catalogName, String databaseName) Get names of all functions, including temp system functions, system functions, temp catalog functions and catalog functions with specific catalog and database.String[]Get names of all user defined functions, including temp system functions, temp catalog functions and catalog functions in the current catalog and current database.Set<org.apache.flink.table.functions.FunctionIdentifier>getUserDefinedFunctions(String catalogName, String databaseName) Get names of all user including temp system functions, temp catalog * functions and catalog functions in the specified catalog and specified database.booleanhasTemporaryCatalogFunction(org.apache.flink.table.catalog.ObjectIdentifier functionIdentifier) Check whether a temporary catalog function is already registered.booleanhasTemporarySystemFunction(String functionName) Check whether a temporary system function is already registered.lookupFunction(org.apache.flink.table.catalog.UnresolvedIdentifier identifier) lookupProcedure(org.apache.flink.table.catalog.UnresolvedIdentifier identifier) voidregisterCatalogFunction(org.apache.flink.table.catalog.UnresolvedIdentifier unresolvedIdentifier, Class<? extends org.apache.flink.table.functions.UserDefinedFunction> functionClass, boolean ignoreIfExists) Registers a catalog function by also considering temporary catalog functions.voidregisterCatalogFunction(org.apache.flink.table.catalog.UnresolvedIdentifier unresolvedIdentifier, String className, List<org.apache.flink.table.resource.ResourceUri> resourceUris, boolean ignoreIfExists) voidregisterFunctionJarResources(String functionName, List<org.apache.flink.table.resource.ResourceUri> resourceUris) voidregisterTempCatalogScalarFunction(org.apache.flink.table.catalog.ObjectIdentifier oi, org.apache.flink.table.functions.ScalarFunction function) Deprecated.voidregisterTemporaryCatalogFunction(org.apache.flink.table.catalog.UnresolvedIdentifier unresolvedIdentifier, org.apache.flink.table.catalog.CatalogFunction catalogFunction, boolean ignoreIfExists) Registers a uninstantiated temporary catalog function.voidregisterTemporaryCatalogFunction(org.apache.flink.table.catalog.UnresolvedIdentifier unresolvedIdentifier, org.apache.flink.table.functions.FunctionDefinition definition, boolean ignoreIfExists) Registers a temporary catalog function.voidregisterTemporarySystemFunction(String name, String className, List<org.apache.flink.table.resource.ResourceUri> resourceUris) Registers a temporary system function from resource uris.voidregisterTemporarySystemFunction(String name, String fullyQualifiedName, org.apache.flink.table.catalog.FunctionLanguage language, boolean ignoreIfExists) Registers a uninstantiated temporary system function.voidregisterTemporarySystemFunction(String name, org.apache.flink.table.catalog.CatalogFunction function, boolean ignoreIfExists) voidregisterTemporarySystemFunction(String name, org.apache.flink.table.functions.FunctionDefinition definition, boolean ignoreIfExists) Registers a temporary system function.<T,ACC> void registerTempSystemAggregateFunction(String name, org.apache.flink.table.functions.ImperativeAggregateFunction<T, ACC> function, org.apache.flink.api.common.typeinfo.TypeInformation<T> resultType, org.apache.flink.api.common.typeinfo.TypeInformation<ACC> accType) Deprecated.voidregisterTempSystemScalarFunction(String name, org.apache.flink.table.functions.ScalarFunction function) Deprecated.<T> voidregisterTempSystemTableFunction(String name, org.apache.flink.table.functions.TableFunction<T> function, org.apache.flink.api.common.typeinfo.TypeInformation<T> resultType) Deprecated.
-
Constructor Details
-
FunctionCatalog
public FunctionCatalog(org.apache.flink.configuration.ReadableConfig config, ResourceManager resourceManager, CatalogManager catalogManager, ModuleManager moduleManager)
-
-
Method Details
-
registerTemporarySystemFunction
public void registerTemporarySystemFunction(String name, org.apache.flink.table.functions.FunctionDefinition definition, boolean ignoreIfExists) Registers a temporary system function. -
registerTemporarySystemFunction
public void registerTemporarySystemFunction(String name, String fullyQualifiedName, org.apache.flink.table.catalog.FunctionLanguage language, boolean ignoreIfExists) Registers a uninstantiated temporary system function. -
registerTemporarySystemFunction
public void registerTemporarySystemFunction(String name, String className, List<org.apache.flink.table.resource.ResourceUri> resourceUris) Registers a temporary system function from resource uris. -
dropTemporarySystemFunction
Drops a temporary system function. Returns true if a function was dropped. -
registerTemporaryCatalogFunction
public void registerTemporaryCatalogFunction(org.apache.flink.table.catalog.UnresolvedIdentifier unresolvedIdentifier, org.apache.flink.table.functions.FunctionDefinition definition, boolean ignoreIfExists) Registers a temporary catalog function. -
registerTemporaryCatalogFunction
public void registerTemporaryCatalogFunction(org.apache.flink.table.catalog.UnresolvedIdentifier unresolvedIdentifier, org.apache.flink.table.catalog.CatalogFunction catalogFunction, boolean ignoreIfExists) Registers a uninstantiated temporary catalog function. -
dropTemporaryCatalogFunction
public boolean dropTemporaryCatalogFunction(org.apache.flink.table.catalog.UnresolvedIdentifier unresolvedIdentifier, boolean ignoreIfNotExist) Drops a temporary catalog function. Returns true if a function was dropped. -
registerCatalogFunction
public void registerCatalogFunction(org.apache.flink.table.catalog.UnresolvedIdentifier unresolvedIdentifier, Class<? extends org.apache.flink.table.functions.UserDefinedFunction> functionClass, boolean ignoreIfExists) Registers a catalog function by also considering temporary catalog functions. -
registerCatalogFunction
-
dropCatalogFunction
public boolean dropCatalogFunction(org.apache.flink.table.catalog.UnresolvedIdentifier unresolvedIdentifier, boolean ignoreIfNotExist) Drops a catalog function by also considering temporary catalog functions. Returns true if a function was dropped. -
getUserDefinedFunctions
Get names of all user defined functions, including temp system functions, temp catalog functions and catalog functions in the current catalog and current database. -
getUserDefinedFunctions
public Set<org.apache.flink.table.functions.FunctionIdentifier> getUserDefinedFunctions(String catalogName, String databaseName) Get names of all user including temp system functions, temp catalog * functions and catalog functions in the specified catalog and specified database. -
getFunctions
Get names of all functions, including temp system functions, system functions, temp catalog functions and catalog functions in the current catalog and current database. -
getFunctions
Get names of all functions, including temp system functions, system functions, temp catalog functions and catalog functions with specific catalog and database. -
hasTemporaryCatalogFunction
public boolean hasTemporaryCatalogFunction(org.apache.flink.table.catalog.ObjectIdentifier functionIdentifier) Check whether a temporary catalog function is already registered.- Parameters:
functionIdentifier- the object identifier of function- Returns:
- whether the temporary catalog function exists in the function catalog
-
hasTemporarySystemFunction
Check whether a temporary system function is already registered.- Parameters:
functionName- the name of the function- Returns:
- whether the temporary system function exists in the function catalog
-
asLookup
public FunctionLookup asLookup(Function<String, org.apache.flink.table.catalog.UnresolvedIdentifier> parser) Creates aFunctionLookupto thisFunctionCatalog.- Parameters:
parser- parser to use for parsing identifiers
-
lookupProcedure
public Optional<ContextResolvedProcedure> lookupProcedure(org.apache.flink.table.catalog.UnresolvedIdentifier identifier) -
lookupFunction
public Optional<ContextResolvedFunction> lookupFunction(org.apache.flink.table.catalog.UnresolvedIdentifier identifier) -
registerTempSystemScalarFunction
@Deprecated public void registerTempSystemScalarFunction(String name, org.apache.flink.table.functions.ScalarFunction function) Deprecated. -
registerTempSystemTableFunction
@Deprecated public <T> void registerTempSystemTableFunction(String name, org.apache.flink.table.functions.TableFunction<T> function, org.apache.flink.api.common.typeinfo.TypeInformation<T> resultType) Deprecated. -
registerTempSystemAggregateFunction
@Deprecated public <T,ACC> void registerTempSystemAggregateFunction(String name, org.apache.flink.table.functions.ImperativeAggregateFunction<T, ACC> function, org.apache.flink.api.common.typeinfo.TypeInformation<T> resultType, org.apache.flink.api.common.typeinfo.TypeInformation<ACC> accType) Deprecated. -
registerTempCatalogScalarFunction
@Deprecated public void registerTempCatalogScalarFunction(org.apache.flink.table.catalog.ObjectIdentifier oi, org.apache.flink.table.functions.ScalarFunction function) Deprecated. -
dropTempCatalogFunction
public org.apache.flink.table.catalog.CatalogFunction dropTempCatalogFunction(org.apache.flink.table.catalog.ObjectIdentifier identifier, boolean ignoreIfNotExist) Drop a temporary catalog function.- Parameters:
identifier- identifier of the functionignoreIfNotExist- Flag to specify behavior when the function does not exist: if set to false, throw an exception, if set to true, do nothing.- Returns:
- the removed catalog function, which is null if function doesn't exist and ignoreIfNotExist is true.
-
registerTemporarySystemFunction
public void registerTemporarySystemFunction(String name, org.apache.flink.table.catalog.CatalogFunction function, boolean ignoreIfExists) -
registerFunctionJarResources
-
copy
-
registerTemporaryCatalogFunction(UnresolvedIdentifier, FunctionDefinition, boolean)instead.