Skip to main content

Module aggregation

Module aggregation 

Source
Expand description

Aggregation monoids and posting-list aggregate operators.

Aggregation functions form a monoid (Section 5.1, Paper 1) so a parallel executor can split the input, fold each shard with AggregationMonoid::accumulate, merge the partial states with AggregationMonoid::combine, and emit the final value via AggregationMonoid::finalize.

§Concrete monoids

§Operators

  • AggregateOperator folds a posting list with the supplied monoid and emits a single-entry posting list whose payload carries _aggregate_field / _aggregate metadata.
  • GroupByOperator groups by a field, folds a second field with the monoid per group, and emits one entry per group.

Structs§

AggregateOperator
Apply a monoid over a single field across the rows the source operator produces. Emits a one-entry posting list whose payload carries _aggregate_field / _aggregate so downstream callers can pick the result by name.
AvgMonoid
AvgState
Pair-wise additive state used by AvgMonoid.
CountMonoid
GroupByOperator
Group documents by group_field and fold agg_field per group.
MaxMonoid
MinMonoid
QuantileMonoid
Quantile aggregation: collects observed values and computes the requested quantile at finalize. quantile = 0.5 is the median.
SumMonoid

Enums§

AggState
Generic aggregation state. Concrete monoids consume / emit the variants they care about; a mismatched variant is an execution error rather than a silently accepted partial fold.

Traits§

AggregationMonoid
Aggregation function with monoid structure for parallel decomposition. See Section 5.1, Paper 1.