@Internal public final class FunctionCatalog extends Object
FunctionDefinition
s 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(ReadableConfig config,
ResourceManager resourceManager,
CatalogManager catalogManager,
ModuleManager moduleManager) |
Modifier and Type | Method and Description |
---|---|
FunctionLookup |
asLookup(java.util.function.Function<String,UnresolvedIdentifier> parser)
Creates a
FunctionLookup to this FunctionCatalog . |
boolean |
dropCatalogFunction(UnresolvedIdentifier unresolvedIdentifier,
boolean ignoreIfNotExist)
Drops a catalog function by also considering temporary catalog functions.
|
CatalogFunction |
dropTempCatalogFunction(ObjectIdentifier identifier,
boolean ignoreIfNotExist)
Drop a temporary catalog function.
|
boolean |
dropTemporaryCatalogFunction(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[] |
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<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(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(UnresolvedIdentifier identifier) |
void |
registerCatalogFunction(UnresolvedIdentifier unresolvedIdentifier,
Class<? extends UserDefinedFunction> functionClass,
boolean ignoreIfExists)
Registers a catalog function by also considering temporary catalog functions.
|
void |
registerCatalogFunction(UnresolvedIdentifier unresolvedIdentifier,
String className,
List<ResourceUri> resourceUris,
boolean ignoreIfExists) |
void |
registerFunctionJarResources(String functionName,
List<ResourceUri> resourceUris) |
void |
registerTempCatalogScalarFunction(ObjectIdentifier oi,
ScalarFunction function)
Deprecated.
|
void |
registerTemporaryCatalogFunction(UnresolvedIdentifier unresolvedIdentifier,
CatalogFunction catalogFunction,
boolean ignoreIfExists)
Registers a uninstantiated temporary catalog function.
|
void |
registerTemporaryCatalogFunction(UnresolvedIdentifier unresolvedIdentifier,
FunctionDefinition definition,
boolean ignoreIfExists)
Registers a temporary catalog function.
|
void |
registerTemporarySystemFunction(String name,
CatalogFunction function,
boolean ignoreIfExists) |
void |
registerTemporarySystemFunction(String name,
FunctionDefinition definition,
boolean ignoreIfExists)
Registers a temporary system function.
|
void |
registerTemporarySystemFunction(String name,
String fullyQualifiedName,
FunctionLanguage language,
boolean ignoreIfExists)
Registers a uninstantiated temporary system function.
|
void |
registerTemporarySystemFunction(String name,
String className,
List<ResourceUri> resourceUris)
Registers a temporary system function from resource uris.
|
<T,ACC> void |
registerTempSystemAggregateFunction(String name,
ImperativeAggregateFunction<T,ACC> function,
TypeInformation<T> resultType,
TypeInformation<ACC> accType)
Deprecated.
|
void |
registerTempSystemScalarFunction(String name,
ScalarFunction function)
Deprecated.
|
<T> void |
registerTempSystemTableFunction(String name,
TableFunction<T> function,
TypeInformation<T> resultType)
Deprecated.
|
void |
setPlannerTypeInferenceUtil(PlannerTypeInferenceUtil plannerTypeInferenceUtil) |
public FunctionCatalog(ReadableConfig config, ResourceManager resourceManager, CatalogManager catalogManager, ModuleManager moduleManager)
public void setPlannerTypeInferenceUtil(PlannerTypeInferenceUtil plannerTypeInferenceUtil)
public void registerTemporarySystemFunction(String name, FunctionDefinition definition, boolean ignoreIfExists)
public void registerTemporarySystemFunction(String name, String fullyQualifiedName, FunctionLanguage language, boolean ignoreIfExists)
public void registerTemporarySystemFunction(String name, String className, List<ResourceUri> resourceUris)
public boolean dropTemporarySystemFunction(String name, boolean ignoreIfNotExist)
public void registerTemporaryCatalogFunction(UnresolvedIdentifier unresolvedIdentifier, FunctionDefinition definition, boolean ignoreIfExists)
public void registerTemporaryCatalogFunction(UnresolvedIdentifier unresolvedIdentifier, CatalogFunction catalogFunction, boolean ignoreIfExists)
public boolean dropTemporaryCatalogFunction(UnresolvedIdentifier unresolvedIdentifier, boolean ignoreIfNotExist)
public void registerCatalogFunction(UnresolvedIdentifier unresolvedIdentifier, Class<? extends UserDefinedFunction> functionClass, boolean ignoreIfExists)
public void registerCatalogFunction(UnresolvedIdentifier unresolvedIdentifier, String className, List<ResourceUri> resourceUris, boolean ignoreIfExists)
public boolean dropCatalogFunction(UnresolvedIdentifier unresolvedIdentifier, boolean ignoreIfNotExist)
public String[] getUserDefinedFunctions()
public Set<FunctionIdentifier> getUserDefinedFunctions(String catalogName, String databaseName)
public String[] getFunctions()
public boolean hasTemporaryCatalogFunction(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,UnresolvedIdentifier> parser)
FunctionLookup
to this FunctionCatalog
.parser
- parser to use for parsing identifierspublic Optional<ContextResolvedFunction> lookupFunction(UnresolvedIdentifier identifier)
@Deprecated public void registerTempSystemScalarFunction(String name, ScalarFunction function)
registerTemporarySystemFunction(String, FunctionDefinition, boolean)
instead.@Deprecated public <T> void registerTempSystemTableFunction(String name, TableFunction<T> function, TypeInformation<T> resultType)
registerTemporarySystemFunction(String, FunctionDefinition, boolean)
instead.@Deprecated public <T,ACC> void registerTempSystemAggregateFunction(String name, ImperativeAggregateFunction<T,ACC> function, TypeInformation<T> resultType, TypeInformation<ACC> accType)
registerTemporarySystemFunction(String, FunctionDefinition, boolean)
instead.@Deprecated public void registerTempCatalogScalarFunction(ObjectIdentifier oi, ScalarFunction function)
registerTemporaryCatalogFunction(UnresolvedIdentifier,
FunctionDefinition, boolean)
instead.public CatalogFunction dropTempCatalogFunction(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, CatalogFunction function, boolean ignoreIfExists)
public void registerFunctionJarResources(String functionName, List<ResourceUri> resourceUris)
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.