fn reduction_type(func: &AggregateFunc) -> ReductionType
Expand description

Determines whether a function can be accumulated in an update’s “difference” field, and whether it can be subjected to recursive (hierarchical) aggregation.

Accumulable aggregations will be packed into differential dataflow’s “difference” field, which can be accumulated in-place using the addition operation on the type. Aggregations that indicate they are accumulable will still need to provide an action that takes their data and introduces it as a difference, and the post-processing when the accumulated value is presented as data.

Hierarchical aggregations will be subjected to repeated aggregation on initially small but increasingly large subsets of each key. This has the intended property that no invocation is on a significantly large set of values (and so, no incremental update needs to reform significant input data). Hierarchical aggregates can be rendered more efficiently if the input stream is append-only as then we only need to retain the “currently winning” value. Every hierarchical aggregate needs to supply a corresponding ReductionMonoid implementation.