ScalaUDAF Expression¶
ScalaUDAF is an ImperativeAggregate expression.
ScalaUDAF is a UserDefinedExpression.
ScalaUDAF is a NonSQLExpression.
Deprecation
ScalaUDAF uses UserDefinedAggregateFunction class that is marked as deprecated as of Spark SQL 3.0.0 with the following comment:
Aggregator[IN, BUF, OUT] should now be registered as a UDF via the functions.udaf(agg) method.
Creating Instance¶
ScalaUDAF takes the following to be created:
- Children (Expressions)
- UserDefinedAggregateFunction
-
mutableAggBufferOffset(default:0) -
inputAggBufferOffset(default:0) - Name (optional)
ScalaUDAF is created when:
UDFRegistrationis requested to register a UserDefinedAggregateFunctionUserDefinedAggregateFunctionis requested to create a Column for a UDAF and distinctSparkUDFExpressionBuilderis requested tomakeExpression