abstract class UserDefinedAggregateFunction extends Serializable with UserDefinedFunctionLike
The base class for implementing user-defined aggregate functions (UDAF).
- Annotations
- @Stable() @deprecated
- Deprecated
- (Since version 3.0.0) Aggregator[IN, BUF, OUT] should now be registered as a UDF via the functions.udaf(agg) method. 
- Source
- udaf.scala
- Since
- 1.5.0 
- Alphabetic
- By Inheritance
- UserDefinedAggregateFunction
- UserDefinedFunctionLike
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
-    new UserDefinedAggregateFunction()- Deprecated
- UserDefinedAggregateFunction is deprecated. Aggregator[IN, BUF, OUT] should now be registered as a UDF via the functions.udaf(agg) method. 
 
Abstract Value Members
-   abstract  def bufferSchema: StructTypeA StructTyperepresents data types of values in the aggregation buffer.A StructTyperepresents 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 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.- Since
- 1.5.0 
 
-   abstract  def dataType: DataTypeThe DataTypeof the returned value of this UserDefinedAggregateFunction.The DataTypeof the returned value of this UserDefinedAggregateFunction.- Since
- 1.5.0 
 
-   abstract  def deterministic: BooleanReturns true iff this function is deterministic, i.e. Returns true iff this function is deterministic, i.e. given the same input, always return the same output. - Since
- 1.5.0 
 
-   abstract  def evaluate(buffer: Row): AnyCalculates the final result of this UserDefinedAggregateFunction based on the given aggregation buffer. Calculates the final result of this UserDefinedAggregateFunction based on the given aggregation buffer. - Since
- 1.5.0 
 
-   abstract  def initialize(buffer: MutableAggregationBuffer): UnitInitializes the given aggregation buffer, i.e. 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.- Since
- 1.5.0 
 
-   abstract  def inputSchema: StructTypeA StructTyperepresents data types of input arguments of this aggregate function.A StructTyperepresents data types of input arguments of this aggregate function. For example, if a UserDefinedAggregateFunction expects 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.- Since
- 1.5.0 
 
-   abstract  def merge(buffer1: MutableAggregationBuffer, buffer2: Row): UnitMerges 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. - Since
- 1.5.0 
 
-   abstract  def update(buffer: MutableAggregationBuffer, input: Row): UnitUpdates the given aggregation buffer bufferwith new input data frominput.Updates the given aggregation buffer bufferwith new input data frominput.This is called once per input row. - Since
- 1.5.0 
 
Concrete Value Members
-   final  def !=(arg0: Any): Boolean- Definition Classes
- AnyRef → Any
 
-   final  def ##: Int- Definition Classes
- AnyRef → Any
 
-   final  def ==(arg0: Any): Boolean- Definition Classes
- AnyRef → Any
 
-    def apply(exprs: Column*): ColumnCreates a Columnfor this UDAF using givenColumns as input arguments.Creates a Columnfor this UDAF using givenColumns as input arguments.- Annotations
- @varargs()
- Since
- 1.5.0 
 
-   final  def asInstanceOf[T0]: T0- Definition Classes
- Any
 
-    def clone(): AnyRef- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
 
-    def distinct(exprs: Column*): ColumnCreates a Columnfor this UDAF using the distinct values of the givenColumns as input arguments.Creates a Columnfor this UDAF using the distinct values of the givenColumns as input arguments.- Annotations
- @varargs()
- Since
- 1.5.0 
 
-   final  def eq(arg0: AnyRef): Boolean- Definition Classes
- AnyRef
 
-    def equals(arg0: AnyRef): Boolean- Definition Classes
- AnyRef → Any
 
-   final  def getClass(): Class[_ <: AnyRef]- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
 
-    def hashCode(): Int- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
 
-   final  def isInstanceOf[T0]: Boolean- Definition Classes
- Any
 
-    def name: String- Definition Classes
- UserDefinedFunctionLike
 
-   final  def ne(arg0: AnyRef): Boolean- Definition Classes
- AnyRef
 
-   final  def notify(): Unit- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
 
-   final  def notifyAll(): Unit- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
 
-   final  def synchronized[T0](arg0: => T0): T0- Definition Classes
- AnyRef
 
-    def toString(): String- Definition Classes
- AnyRef → Any
 
-   final  def wait(arg0: Long, arg1: Int): Unit- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
 
-   final  def wait(arg0: Long): Unit- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
 
-   final  def wait(): Unit- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
 
Deprecated Value Members
-    def finalize(): Unit- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
- (Since version 9)