Class UserDefinedAggregateFunction
- All Implemented Interfaces:
Serializable
,org.apache.spark.sql.internal.UserDefinedFunctionLike
- Since:
- 1.5.0
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Creates aColumn
for this UDAF using givenColumn
s as input arguments.Deprecated.Creates aColumn
for this UDAF using givenColumn
s as input arguments.abstract StructType
Deprecated.AStructType
represents data types of values in the aggregation buffer.abstract DataType
dataType()
Deprecated.TheDataType
of the returned value of thisUserDefinedAggregateFunction
.abstract boolean
Deprecated.Returns true iff this function is deterministic, i.e.Deprecated.Creates aColumn
for this UDAF using the distinct values of the givenColumn
s as input arguments.Deprecated.Creates aColumn
for this UDAF using the distinct values of the givenColumn
s as input arguments.abstract Object
Deprecated.Calculates the final result of thisUserDefinedAggregateFunction
based on the given aggregation buffer.abstract void
initialize
(MutableAggregationBuffer buffer) Deprecated.Initializes the given aggregation buffer, i.e.abstract StructType
Deprecated.AStructType
represents data types of input arguments of this aggregate function.abstract void
merge
(MutableAggregationBuffer buffer1, Row buffer2) Deprecated.Merges two aggregation buffers and stores the updated buffer values back tobuffer1
.abstract void
update
(MutableAggregationBuffer buffer, Row input) Deprecated.Updates the given aggregation bufferbuffer
with new input data frominput
.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.spark.sql.internal.UserDefinedFunctionLike
name
-
Constructor Details
-
UserDefinedAggregateFunction
public UserDefinedAggregateFunction()Deprecated.
-
-
Method Details
-
apply
Deprecated.Creates aColumn
for this UDAF using givenColumn
s as input arguments.- Parameters:
exprs
- (undocumented)- Returns:
- (undocumented)
- Since:
- 1.5.0
-
apply
Deprecated.Creates aColumn
for this UDAF using givenColumn
s as input arguments.- Parameters:
exprs
- (undocumented)- Returns:
- (undocumented)
- Since:
- 1.5.0
-
bufferSchema
Deprecated.AStructType
represents data types of values in the aggregation buffer. For example, if aUserDefinedAggregateFunction
's buffer has two values (i.e. two intermediate values) with type ofDoubleType
andLongType
, the returnedStructType
will look likenew 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.- Returns:
- (undocumented)
- Since:
- 1.5.0
-
dataType
Deprecated.TheDataType
of the returned value of thisUserDefinedAggregateFunction
.- Returns:
- (undocumented)
- Since:
- 1.5.0
-
deterministic
public abstract boolean deterministic()Deprecated.Returns true iff this function is deterministic, i.e. given the same input, always return the same output.- Returns:
- (undocumented)
- Since:
- 1.5.0
-
distinct
Deprecated.Creates aColumn
for this UDAF using the distinct values of the givenColumn
s as input arguments.- Parameters:
exprs
- (undocumented)- Returns:
- (undocumented)
- Since:
- 1.5.0
-
distinct
Deprecated.Creates aColumn
for this UDAF using the distinct values of the givenColumn
s as input arguments.- Parameters:
exprs
- (undocumented)- Returns:
- (undocumented)
- Since:
- 1.5.0
-
evaluate
Deprecated.Calculates the final result of thisUserDefinedAggregateFunction
based on the given aggregation buffer.- Parameters:
buffer
- (undocumented)- Returns:
- (undocumented)
- Since:
- 1.5.0
-
initialize
Deprecated.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 equalinitialBuffer
.- Parameters:
buffer
- (undocumented)- Since:
- 1.5.0
-
inputSchema
Deprecated.AStructType
represents data types of input arguments of this aggregate function. For example, if aUserDefinedAggregateFunction
expects two input arguments with type ofDoubleType
andLongType
, the returnedStructType
will look likenew 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.- Returns:
- (undocumented)
- Since:
- 1.5.0
-
merge
Deprecated.Merges two aggregation buffers and stores the updated buffer values back tobuffer1
.This is called when we merge two partially aggregated data together.
- Parameters:
buffer1
- (undocumented)buffer2
- (undocumented)- Since:
- 1.5.0
-
update
Deprecated.Updates the given aggregation bufferbuffer
with new input data frominput
.This is called once per input row.
- Parameters:
buffer
- (undocumented)input
- (undocumented)- Since:
- 1.5.0
-