Skip to content

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:

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)!
  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:

Implementations

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:

  • UDFRegistration is requested to register a user-defined function written in Python or Scala