Aggregator
This class is the main entry-point for creating an aggregator.
Aggregators are used to compute a single value from a Sequence of values, a single DataColumn, or multiple DataColumns.
Aggregator follows a dependency injection pattern:
Using the constructor or Aggregator.invoke function, you can create an Aggregator instance with a choice of:
AggregatorInputHandler- The input handler of the aggregator, which handles type checks, conversions, and preprocessing of a single sequence of input values. It can also calculate a specificvalue typefrom the input values or input types if the (specific) type is not known.
Options: NumberInputHandler, AnyInputHandler
AggregatorAggregationHandler- The base functionality of the aggregator, which defines how the aggregation of a singleSequenceorcolumnis done. It also provides information on which return type will be given, asKType, given avalue type. It can also provide the index of the result in the input values if it is a selecting aggregator.
Options: ReducingAggregationHandler, SelectingAggregationHandler
AggregatorMultipleColumnsHandler- The multiple columns handler, which specifies how to aggregate multiple columns into a single value by using the suppliedAggregatorAggregationHandler. It can also calculate the return type of the aggregation given all input column types.
Options: FlatteningMultipleColumnsHandler, TwoStepMultipleColumnsHandler, NoMultipleColumnsHandler
Type Parameters
The non-null type of the values to be aggregated. The input can always have nulls, they are filtered out.
The type of the resulting value. Can optionally be nullable.
See also
Constructors
Properties
Functions
Aggregates the data in the given columns and computes a single resulting value.
Aggregates the data in the given column and computes a single resulting value.
Performs aggregation on the given values, taking valueType into account. If valueType is unknown, see calculateValueType or aggregateCalculatingValueType.
Selects the best matching value in the iterable using the provided Aggregator by the provided selector.
Selects the best matching value in the sequence using the provided Aggregator by the provided selector.
Selects the best matching value in the column using the provided Aggregator by the provided selector.
Selects the best matching value in the dataframe using the provided Aggregator by the provided rowExpression.
Selects the best matching value in the dataframe using the provided Aggregator by the provided column.
If the specific ValueType of the input is not known, but you still want to call aggregate, this function can be called to calculate it by combining the set of known valueTypes or by gathering the types from values and then aggregating them.
Aggregates the data in the multiple given columns and computes a single resulting value. Calls Aggregator.aggregateSequence or Aggregator.aggregateSingleColumn.
Aggregates frame by first applying expression to each row of the frame and then applying the Aggregator (this) to the resulting sequence.
Aggregates values by first applying transform to each element of the sequence and then applying the Aggregator (this) to the resulting sequence.
Aggregates column by first applying transform to each element of the column and then applying the Aggregator (this) to the resulting sequence.
Aggregates data by first applying expression to each row of the frame and then
Generic function to apply an Aggregator (this) to aggregate values of a row.
Base function of Aggregator.
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
Function that can give the return type of aggregateSequence as KType, given the type of the input. This allows aggregators to avoid runtime type calculations.
Function that can give the return type of aggregateMultipleColumns, given types of the columns. This allows aggregators to avoid runtime type calculations.
If the specific ValueType of the input is not known, but you still want to call aggregate, this function can be called to calculate it by combining the set of known valueTypes.
WARNING: HEAVY!
If the specific ValueType of the input is not known, but you still want to call aggregate, this function can be called to calculate it by combining the set of known valueTypes or by gathering the types from values.
Gives the index of the aggregation result in the input values, if it applies. This is used for aggregators with an AggregatorAggregationHandler where Value== Return, and where the result exists in the input.
Function that can give the index of the aggregation result in the input values, if it applies. This is used for AggregatorAggregationHandlers where Value== Return, and where the result exists in the input.
Preprocesses the input values before aggregation. It's expected that this function converts values to the right valueType.kType if valueType.needsFullConversion.