Skip to content


UDFRegistration is a facade to a session-scoped FunctionRegistry to register user-defined functions (UDFs) and user-defined aggregate functions (UDAFs).

Creating Instance

UDFRegistration takes the following to be created:

UDFRegistration is created when:

Accessing UDFRegistration

UDFRegistration is available using SparkSession.udf.

import org.apache.spark.sql.SparkSession
import org.apache.spark.sql.UDFRegistration


UDFRegistration is used to create a SessionState.

Registering UserDefinedFunction

  name: String,
  udf: UserDefinedFunction): UserDefinedFunction

register associates the given name with the given UserDefinedFunction.

register requests the FunctionRegistry to createOrReplaceTempFunction under the given name and with scala_udf source name and a function builder based on the type of the UserDefinedFunction:

Back to top