Packages

c

org.apache.spark.sql.expressions

UserDefinedAggregateFunction

abstract class UserDefinedAggregateFunction extends Serializable

The base class for implementing user-defined aggregate functions (UDAF).

Annotations
@Stable() @deprecated
Deprecated

(Since version 3.0.0)

Source
udaf.scala
Since

1.5.0

Linear Supertypes
Serializable, Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. UserDefinedAggregateFunction
  2. Serializable
  3. Serializable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. 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

  1. abstract def bufferSchema: StructType

    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.

    Since

    1.5.0

  2. abstract def dataType: DataType

    The DataType of the returned value of this UserDefinedAggregateFunction.

    The DataType of the returned value of this UserDefinedAggregateFunction.

    Since

    1.5.0

  3. abstract def deterministic: Boolean

    Returns 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

  4. abstract def evaluate(buffer: Row): Any

    Calculates 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

  5. abstract def initialize(buffer: MutableAggregationBuffer): Unit

    Initializes 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 equal initialBuffer.

    Since

    1.5.0

  6. abstract def inputSchema: StructType

    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.

    Since

    1.5.0

  7. abstract def merge(buffer1: MutableAggregationBuffer, buffer2: Row): Unit

    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.

    Since

    1.5.0

  8. abstract def update(buffer: MutableAggregationBuffer, input: Row): Unit

    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.

    Since

    1.5.0

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def apply(exprs: Column*): Column

    Creates a Column for this UDAF using given Columns as input arguments.

    Creates a Column for this UDAF using given Columns as input arguments.

    Annotations
    @varargs()
    Since

    1.5.0

  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  7. def distinct(exprs: Column*): Column

    Creates a Column for this UDAF using the distinct values of the given Columns as input arguments.

    Creates a Column for this UDAF using the distinct values of the given Columns as input arguments.

    Annotations
    @varargs()
    Since

    1.5.0

  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  12. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  13. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  14. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  16. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  17. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  18. def toString(): String
    Definition Classes
    AnyRef → Any
  19. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  20. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  21. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped