Class UserDefinedAggregateFunction
- All Implemented Interfaces:
Serializable,org.apache.spark.sql.internal.UserDefinedFunctionLike
- Since:
- 1.5.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Creates aColumnfor this UDAF using givenColumns as input arguments.Deprecated.Creates aColumnfor this UDAF using givenColumns as input arguments.abstract StructTypeDeprecated.AStructTyperepresents data types of values in the aggregation buffer.abstract DataTypedataType()Deprecated.TheDataTypeof the returned value of thisUserDefinedAggregateFunction.abstract booleanDeprecated.Returns true iff this function is deterministic, i.e.Deprecated.Creates aColumnfor this UDAF using the distinct values of the givenColumns as input arguments.Deprecated.Creates aColumnfor this UDAF using the distinct values of the givenColumns as input arguments.abstract ObjectDeprecated.Calculates the final result of thisUserDefinedAggregateFunctionbased on the given aggregation buffer.abstract voidinitialize(MutableAggregationBuffer buffer) Deprecated.Initializes the given aggregation buffer, i.e.abstract StructTypeDeprecated.AStructTyperepresents data types of input arguments of this aggregate function.abstract voidmerge(MutableAggregationBuffer buffer1, Row buffer2) Deprecated.Merges two aggregation buffers and stores the updated buffer values back tobuffer1.abstract voidupdate(MutableAggregationBuffer buffer, Row input) Deprecated.Updates the given aggregation bufferbufferwith new input data frominput.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.spark.sql.internal.UserDefinedFunctionLike
name
-
Constructor Details
-
UserDefinedAggregateFunction
public UserDefinedAggregateFunction()Deprecated.
-
-
Method Details
-
apply
Deprecated.Creates aColumnfor this UDAF using givenColumns as input arguments.- Parameters:
exprs- (undocumented)- Returns:
- (undocumented)
- Since:
- 1.5.0
-
apply
Deprecated.Creates aColumnfor this UDAF using givenColumns as input arguments.- Parameters:
exprs- (undocumented)- Returns:
- (undocumented)
- Since:
- 1.5.0
-
bufferSchema
Deprecated.AStructTyperepresents data types of values in the aggregation buffer. For example, if aUserDefinedAggregateFunction's buffer has two values (i.e. two intermediate values) with type ofDoubleTypeandLongType, the returnedStructTypewill look likenew StructType() .add("doubleInput", DoubleType) .add("longInput", LongType)The name of a field of this
StructTypeis 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.TheDataTypeof 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 aColumnfor this UDAF using the distinct values of the givenColumns as input arguments.- Parameters:
exprs- (undocumented)- Returns:
- (undocumented)
- Since:
- 1.5.0
-
distinct
Deprecated.Creates aColumnfor this UDAF using the distinct values of the givenColumns as input arguments.- Parameters:
exprs- (undocumented)- Returns:
- (undocumented)
- Since:
- 1.5.0
-
evaluate
Deprecated.Calculates the final result of thisUserDefinedAggregateFunctionbased 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.AStructTyperepresents data types of input arguments of this aggregate function. For example, if aUserDefinedAggregateFunctionexpects two input arguments with type ofDoubleTypeandLongType, the returnedStructTypewill look likenew StructType() .add("doubleInput", DoubleType) .add("longInput", LongType)The name of a field of this
StructTypeis 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 bufferbufferwith new input data frominput.This is called once per input row.
- Parameters:
buffer- (undocumented)input- (undocumented)- Since:
- 1.5.0
-