ReducingAggregationHandler

Implementation of AggregatorAggregationHandler which functions like a reducer: it takes a sequence of values and returns a single value, which can be a completely different type.

Parameters

reducer

This function actually does the reduction. Before it is called, nulls are filtered out. The type of the values is passed as KType to the reducer.

getReturnType

This function must be supplied to give the return type of reducer given some input type and whether the input is empty.

See also

Constructors

Link copied to clipboard
constructor(reducer: Reducer<Value, Return>, getReturnType: CalculateReturnType)

Properties

Link copied to clipboard
open override var aggregator: Aggregator<Value, Return>?

Reference to the aggregator instance.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open override fun aggregateSequence(values: Sequence<Value?>, valueType: ValueType): Return

Base function of Aggregator.

Link copied to clipboard

Aggregates the data in the given column and computes a single resulting value. Calls aggregateSequence. It tries to exploit a cache for statistics which can be accessed by ValueColumnInternal

Link copied to clipboard
open override fun calculateReturnType(valueType: KType, emptyInput: Boolean): KType

Give the return type of reducer given some input type and whether the input is empty. Calls the supplied getReturnType.

Link copied to clipboard
open override fun indexOfAggregationResultSingleSequence(values: Sequence<Value?>, valueType: ValueType): Int

This function always returns -1 because the result of a reducer is not in the input values.

Link copied to clipboard
open fun init(aggregator: Aggregator<Value, Return>)