import org.apache.spark.sql.SparkSession
val spark: SparkSession = ...
spark.udf
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.
UDFRegistration
is created exclusively for SessionState.
Registering UserDefinedAggregateFunction (with FunctionRegistry) — register
Method
register(
name: String,
udaf: UserDefinedAggregateFunction): UserDefinedAggregateFunction
register
registers a UserDefinedAggregateFunction under name
with FunctionRegistry.
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.
|