org.apache.spark.sql.expressions
A StructType represents data types of values in the aggregation buffer.
A StructType represents data types of values in the aggregation buffer. For example, if a UserDefinedAggregateFunction's buffer has two values (i.e. two intermediate values) with type of DoubleType and LongType, the returned StructType will look like
new StructType()
.add("doubleInput", DoubleType)
.add("longInput", LongType)
The name of a field of this StructType is only used to identify the corresponding buffer value. Users can choose names to identify the input arguments.
The DataType of the returned value of this UserDefinedAggregateFunction.
Returns true iff this function is deterministic, i.
Returns true iff this function is deterministic, i.e. given the same input, always return the same output.
Calculates the final result of this UserDefinedAggregateFunction based on the given aggregation buffer.
Initializes the given aggregation buffer, i.
Initializes the given aggregation buffer, i.e. the zero value of the aggregation buffer.
The contract should be that applying the merge function on two initial buffers should just
return the initial buffer itself, i.e.
merge(initialBuffer, initialBuffer)
should equal initialBuffer
.
A StructType represents data types of input arguments of this aggregate function.
A StructType represents data types of input arguments of this aggregate function. For example, if a UserDefinedAggregateFunction expects two input arguments with type of DoubleType and LongType, the returned StructType will look like
new StructType()
.add("doubleInput", DoubleType)
.add("longInput", LongType)
The name of a field of this StructType is only used to identify the corresponding input argument. Users can choose names to identify the input arguments.
Merges two aggregation buffers and stores the updated buffer values back to buffer1
.
Merges two aggregation buffers and stores the updated buffer values back to buffer1
.
This is called when we merge two partially aggregated data together.
Updates the given aggregation buffer buffer
with new input data from input
.
Updates the given aggregation buffer buffer
with new input data from input
.
This is called once per input row.
Creates a Column for this UDAF using given Columns as input arguments.
Creates a Column for this UDAF using the distinct values of the given Columns as input arguments.
:: Experimental :: The base class for implementing user-defined aggregate functions (UDAF).