Class UserDefinedAggregateFunction
- All Implemented Interfaces:
- Serializable,- org.apache.spark.sql.internal.UserDefinedFunctionLike
- Since:
- 1.5.0
- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier 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.Objectequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.spark.sql.internal.UserDefinedFunctionLikename
- 
Constructor Details- 
UserDefinedAggregateFunctionpublic UserDefinedAggregateFunction()Deprecated.
 
- 
- 
Method Details- 
applyDeprecated.Creates aColumnfor this UDAF using givenColumns as input arguments.- Parameters:
- exprs- (undocumented)
- Returns:
- (undocumented)
- Since:
- 1.5.0
 
- 
applyDeprecated.Creates aColumnfor this UDAF using givenColumns as input arguments.- Parameters:
- exprs- (undocumented)
- Returns:
- (undocumented)
- Since:
- 1.5.0
 
- 
bufferSchemaDeprecated.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
 
- 
dataTypeDeprecated.TheDataTypeof the returned value of thisUserDefinedAggregateFunction.- Returns:
- (undocumented)
- Since:
- 1.5.0
 
- 
deterministicpublic 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
 
- 
distinctDeprecated.Creates aColumnfor this UDAF using the distinct values of the givenColumns as input arguments.- Parameters:
- exprs- (undocumented)
- Returns:
- (undocumented)
- Since:
- 1.5.0
 
- 
distinctDeprecated.Creates aColumnfor this UDAF using the distinct values of the givenColumns as input arguments.- Parameters:
- exprs- (undocumented)
- Returns:
- (undocumented)
- Since:
- 1.5.0
 
- 
evaluateDeprecated.Calculates the final result of thisUserDefinedAggregateFunctionbased on the given aggregation buffer.- Parameters:
- buffer- (undocumented)
- Returns:
- (undocumented)
- Since:
- 1.5.0
 
- 
initializeDeprecated.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
 
- 
inputSchemaDeprecated.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
 
- 
mergeDeprecated.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
 
- 
updateDeprecated.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
 
 
-