FunctionRegistryBase¶
FunctionRegistryBase[T]
is an abstraction of function registries for registering functions (that produce a result of type T
).
Contract (Subset)¶
lookupFunction¶
lookupFunction(
name: FunctionIdentifier): Option[ExpressionInfo]
Looks up the ExpressionInfo
metadata of a user-defined function by the given name
See SimpleFunctionRegistryBase
Used when:
FunctionRegistryBase
is requested to check if a function existsSessionCatalog
is requested to lookupBuiltinOrTempFunction, lookupBuiltinOrTempTableFunction, lookupPersistentFunction
Registering Named User-Defined Function¶
registerFunction(
name: FunctionIdentifier,
info: ExpressionInfo,
builder: Seq[Expression] => T): Unit
registerFunction(
name: FunctionIdentifier,
builder: Seq[Expression] => T,
source: String): Unit // (1)!
- A final method that relays to the abstract
registerFunction
Registers a user-defined function (written in Python, Scala or Java) under the given name
See:
Used when:
FunctionRegistryBase
is requested to createOrReplaceTempFunctionSessionCatalog
is requested to registerFunction, resetSparkSessionExtensions
is requested to registerFunctions, registerTableFunctions
Implementations¶
EmptyFunctionRegistryBase
- FunctionRegistry
- SimpleFunctionRegistryBase
- TableFunctionRegistry
createOrReplaceTempFunction¶
createOrReplaceTempFunction(
name: String,
builder: Seq[Expression] => T,
source: String): Unit
createOrReplaceTempFunction
registers a named function (with a FunctionIdentifier
for the given name).
source Argument
source | Call Site |
---|---|
java_udf | UDFRegistration.register |
python_udf | UDFRegistration.registerPython |
scala_udf | UDFRegistration.register |
source
is used to create an ExpressionInfo
for registering a named function.
createOrReplaceTempFunction
is used when: