UserDefinedAggregator takes the following to be created:
- Encoder (of
INs and assumed an ExpressionEncoder)
UserDefinedAggregator is created using udaf standard function.
Creating Column (for Function Execution)¶
apply( exprs: Column*): Column
apply is part of the UserDefinedFunction abstraction.
- ScalaAggregator aggregate function
isDistinctflag disabled (
scalaAggregator( exprs: Seq[Expression]): ScalaAggregator[IN, BUF, OUT]
scalaAggregator assumes the following are all ExpressionEncoders:
In the end,
scalaAggregator creates a ScalaAggregator.
scalaAggregator is used when:
UDFRegistrationis requested to register a UserDefinedAggregator
UserDefinedAggregatoris requested to create a Column (for execution)
Creates Named UserDefinedAggregator¶
withName( name: String): UserDefinedAggregator[IN, BUF, OUT]
withName is part of the UserDefinedFunction abstraction.
withName creates a copy of this
UserDefinedAggregator to use the given
name as the name.