UDFRegistration

UDFRegistration is an interface to the session-scoped FunctionRegistry to register user-defined functions (UDFs) and user-defined aggregate functions (UDAFs).

UDFRegistration is available using SparkSession.

import org.apache.spark.sql.SparkSession
val spark: SparkSession = ...
spark.udf

UDFRegistration is created exclusively for SessionState.

Creating UDFRegistration Instance

UDFRegistration takes the following when created:

Registering UserDefinedAggregateFunction (with FunctionRegistry) — register Method

register(
  name: String,
  udaf: UserDefinedAggregateFunction): UserDefinedAggregateFunction

register creates a ScalaUDAF internally to register a UDAF.

Note
register gives the input udaf aggregate function back after the function has been registered with FunctionRegistry.

results matching ""

    No results matching ""