@Internal public final class FunctionCatalog extends Object
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.
| Modifier and Type | Class and Description |
|---|---|
static class |
FunctionCatalog.InlineCatalogFunction
The CatalogFunction which holds an instantiated UDF.
|
| Constructor and Description |
|---|
FunctionCatalog(org.apache.flink.configuration.ReadableConfig config,
ResourceManager resourceManager,
CatalogManager catalogManager,
ModuleManager moduleManager) |
| Modifier and Type | Method and Description |
|---|---|
FunctionLookup |
asLookup(java.util.function.Function<String,org.apache.flink.table.catalog.UnresolvedIdentifier> parser)
Creates a
FunctionLookup to this FunctionCatalog. |
FunctionCatalog |
copy(ResourceManager newResourceManager) |
boolean |
dropCatalogFunction(org.apache.flink.table.catalog.UnresolvedIdentifier unresolvedIdentifier,
boolean ignoreIfNotExist)
Drops a catalog function by also considering temporary catalog functions.
|
org.apache.flink.table.catalog.CatalogFunction |
dropTempCatalogFunction(org.apache.flink.table.catalog.ObjectIdentifier identifier,
boolean ignoreIfNotExist)
Drop a temporary catalog function.
|
boolean |
dropTemporaryCatalogFunction(org.apache.flink.table.catalog.UnresolvedIdentifier unresolvedIdentifier,
boolean ignoreIfNotExist)
Drops a temporary catalog function.
|
boolean |
dropTemporarySystemFunction(String name,
boolean ignoreIfNotExist)
Drops a temporary system function.
|
String[] |
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.
|
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[] |
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.
|
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.
|
boolean |
hasTemporaryCatalogFunction(org.apache.flink.table.catalog.ObjectIdentifier functionIdentifier)
Check whether a temporary catalog function is already registered.
|
boolean |
hasTemporarySystemFunction(String functionName)
Check whether a temporary system function is already registered.
|
Optional<ContextResolvedFunction> |
lookupFunction(org.apache.flink.table.catalog.UnresolvedIdentifier identifier) |
Optional<ContextResolvedProcedure> |
lookupProcedure(org.apache.flink.table.catalog.UnresolvedIdentifier identifier) |
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.
|
void |
registerCatalogFunction(org.apache.flink.table.catalog.UnresolvedIdentifier unresolvedIdentifier,
String className,
List<org.apache.flink.table.resource.ResourceUri> resourceUris,
boolean ignoreIfExists) |
void |
registerFunctionJarResources(String functionName,
List<org.apache.flink.table.resource.ResourceUri> resourceUris) |
void |
registerTempCatalogScalarFunction(org.apache.flink.table.catalog.ObjectIdentifier oi,
org.apache.flink.table.functions.ScalarFunction function)
Deprecated.
|
void |
registerTemporaryCatalogFunction(org.apache.flink.table.catalog.UnresolvedIdentifier unresolvedIdentifier,
org.apache.flink.table.catalog.CatalogFunction catalogFunction,
boolean ignoreIfExists)
Registers a uninstantiated temporary catalog function.
|
void |
registerTemporaryCatalogFunction(org.apache.flink.table.catalog.UnresolvedIdentifier unresolvedIdentifier,
org.apache.flink.table.functions.FunctionDefinition definition,
boolean ignoreIfExists)
Registers a temporary catalog function.
|
void |
registerTemporarySystemFunction(String name,
org.apache.flink.table.catalog.CatalogFunction function,
boolean ignoreIfExists) |
void |
registerTemporarySystemFunction(String name,
org.apache.flink.table.functions.FunctionDefinition definition,
boolean ignoreIfExists)
Registers a temporary system function.
|
void |
registerTemporarySystemFunction(String name,
String fullyQualifiedName,
org.apache.flink.table.catalog.FunctionLanguage language,
boolean ignoreIfExists)
Registers a uninstantiated temporary system function.
|
void |
registerTemporarySystemFunction(String name,
String className,
List<org.apache.flink.table.resource.ResourceUri> resourceUris)
Registers a temporary system function from resource uris.
|
<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.
|
void |
registerTempSystemScalarFunction(String name,
org.apache.flink.table.functions.ScalarFunction function)
Deprecated.
|
<T> void |
registerTempSystemTableFunction(String name,
org.apache.flink.table.functions.TableFunction<T> function,
org.apache.flink.api.common.typeinfo.TypeInformation<T> resultType)
Deprecated.
|
public FunctionCatalog(org.apache.flink.configuration.ReadableConfig config,
ResourceManager resourceManager,
CatalogManager catalogManager,
ModuleManager moduleManager)
public void registerTemporarySystemFunction(String name, org.apache.flink.table.functions.FunctionDefinition definition, boolean ignoreIfExists)
public void registerTemporarySystemFunction(String name, String fullyQualifiedName, org.apache.flink.table.catalog.FunctionLanguage language, boolean ignoreIfExists)
public void registerTemporarySystemFunction(String name, String className, List<org.apache.flink.table.resource.ResourceUri> resourceUris)
public boolean dropTemporarySystemFunction(String name, boolean ignoreIfNotExist)
public void registerTemporaryCatalogFunction(org.apache.flink.table.catalog.UnresolvedIdentifier unresolvedIdentifier,
org.apache.flink.table.functions.FunctionDefinition definition,
boolean ignoreIfExists)
public void registerTemporaryCatalogFunction(org.apache.flink.table.catalog.UnresolvedIdentifier unresolvedIdentifier,
org.apache.flink.table.catalog.CatalogFunction catalogFunction,
boolean ignoreIfExists)
public boolean dropTemporaryCatalogFunction(org.apache.flink.table.catalog.UnresolvedIdentifier unresolvedIdentifier,
boolean ignoreIfNotExist)
public void registerCatalogFunction(org.apache.flink.table.catalog.UnresolvedIdentifier unresolvedIdentifier,
Class<? extends org.apache.flink.table.functions.UserDefinedFunction> functionClass,
boolean ignoreIfExists)
public void registerCatalogFunction(org.apache.flink.table.catalog.UnresolvedIdentifier unresolvedIdentifier,
String className,
List<org.apache.flink.table.resource.ResourceUri> resourceUris,
boolean ignoreIfExists)
public boolean dropCatalogFunction(org.apache.flink.table.catalog.UnresolvedIdentifier unresolvedIdentifier,
boolean ignoreIfNotExist)
public String[] getUserDefinedFunctions()
public Set<org.apache.flink.table.functions.FunctionIdentifier> getUserDefinedFunctions(String catalogName, String databaseName)
public String[] getFunctions()
public String[] getFunctions(String catalogName, String databaseName)
public boolean hasTemporaryCatalogFunction(org.apache.flink.table.catalog.ObjectIdentifier functionIdentifier)
functionIdentifier - the object identifier of functionpublic boolean hasTemporarySystemFunction(String functionName)
functionName - the name of the functionpublic FunctionLookup asLookup(java.util.function.Function<String,org.apache.flink.table.catalog.UnresolvedIdentifier> parser)
FunctionLookup to this FunctionCatalog.parser - parser to use for parsing identifierspublic Optional<ContextResolvedProcedure> lookupProcedure(org.apache.flink.table.catalog.UnresolvedIdentifier identifier)
public Optional<ContextResolvedFunction> lookupFunction(org.apache.flink.table.catalog.UnresolvedIdentifier identifier)
@Deprecated public void registerTempSystemScalarFunction(String name, org.apache.flink.table.functions.ScalarFunction function)
registerTemporarySystemFunction(String, FunctionDefinition, boolean)
instead.@Deprecated public <T> void registerTempSystemTableFunction(String name, org.apache.flink.table.functions.TableFunction<T> function, org.apache.flink.api.common.typeinfo.TypeInformation<T> resultType)
registerTemporarySystemFunction(String, FunctionDefinition, boolean)
instead.@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)
registerTemporarySystemFunction(String, FunctionDefinition, boolean)
instead.@Deprecated public void registerTempCatalogScalarFunction(org.apache.flink.table.catalog.ObjectIdentifier oi, org.apache.flink.table.functions.ScalarFunction function)
registerTemporaryCatalogFunction(UnresolvedIdentifier,
FunctionDefinition, boolean) instead.public org.apache.flink.table.catalog.CatalogFunction dropTempCatalogFunction(org.apache.flink.table.catalog.ObjectIdentifier identifier,
boolean ignoreIfNotExist)
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.public void registerTemporarySystemFunction(String name, org.apache.flink.table.catalog.CatalogFunction function, boolean ignoreIfExists)
public void registerFunctionJarResources(String functionName, List<org.apache.flink.table.resource.ResourceUri> resourceUris)
public FunctionCatalog copy(ResourceManager newResourceManager)
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.