Interface CopperUserDefinedAggregateFunctionBuilder.CopperUserDefinedAggregateFunctionBuilderToTerminate

All Known Subinterfaces:
CopperUserDefinedAggregateFunctionBuilder.CopperUserDefinedAggregateFunctionBuilderToAddRemovalSupport
All Known Implementing Classes:
AInternalCopperUserDefinedAggregateFunctionBuilderToTerminate, InternalCopperUserDefinedAggregateFunctionBuilderToTerminate, InternalCopperUserDefinedAggregateFunctionBuilderWithRemoval
Enclosing interface:
CopperUserDefinedAggregateFunctionBuilder

public static interface CopperUserDefinedAggregateFunctionBuilder.CopperUserDefinedAggregateFunctionBuilderToTerminate
Interface for User-Defined Aggregate Function (UDAF)-based aggregated measure builder classes.
  • Method Details

    • output

      CopperMeasure output(SerializableFunction<IArrayReader,?> terminateFunction, int outputType)
      Specifies the output type of the aggregated measure, as well as the function to compute the final results from the aggregation buffers.
      Parameters:
      terminateFunction - function to apply on aggregation buffers.
      outputType - the result type of the function.
      Returns:
      The fully-built Copper measure performing the aggregation function.
      See Also:
    • outputAsDouble

      CopperMeasure outputAsDouble(SerializableToDoubleFunction<IArrayReader> terminateFunction)
      Specifies function to compute the final double results from the aggregation buffers.

      This method is a shortcut for output(SerializableFunction, int).

      Parameters:
      terminateFunction - function returning a double value from an aggregation buffer.
      Returns:
      The fully-defined Copper measure performing the aggregation function.
      See Also:
    • outputFromBuffer

      CopperMeasure outputFromBuffer(int bufferPos)
      Specifies that the final result of the UDAF is located at the given position in the aggregation buffer.

      This method is a shortcut for output(SerializableFunction, int):
      For instance

        .outputFromBuffer(2)
       
      is equivalent to
        .output(buffer -> buffer.readXXX(2), Types.TYPE_XXX)
       
      Parameters:
      bufferPos - the position in the buffer of the final result
      Returns:
      The fully-built Copper measure performing the aggregation function.
      See Also: