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
CountMonoid–(0, +)overu64.SumMonoid–(0.0, +)overf64.AvgMonoid–((0.0, 0), pair-wise +)over(sum, count).MinMonoid,MaxMonoid–(infinity, min)/(-infinity, max)overf64.QuantileMonoid– collect-then-finalize quantile estimator.
§Operators
AggregateOperatorfolds a posting list with the supplied monoid and emits a single-entry posting list whose payload carries_aggregate_field/_aggregatemetadata.GroupByOperatorgroups by a field, folds a second field with the monoid per group, and emits one entry per group.
Structs§
- Aggregate
Operator - 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/_aggregateso downstream callers can pick the result by name. - AvgMonoid
- AvgState
- Pair-wise additive state used by
AvgMonoid. - Count
Monoid - Group
ByOperator - Group documents by
group_fieldand foldagg_fieldper group. - MaxMonoid
- MinMonoid
- Quantile
Monoid - Quantile aggregation: collects observed values and computes the
requested quantile at finalize.
quantile = 0.5is 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§
- Aggregation
Monoid - Aggregation function with monoid structure for parallel decomposition. See Section 5.1, Paper 1.