Built-in aggregation functions, ported from
row-aggregation/aggregationFns.ts.
An AggregationFn folds the values of a column over a group's leaf rows.
Some also know how to merge the results of child groups, which lets nested
groups avoid re-reading every leaf.
Sum of Number values; other values count as zero.
Smallest Number or Date; Null when there is none.
Largest Number or Date; Null when there is none.
List [ min, max ], or List [ Null, Null ] when there is no value of a
comparable kind.
Arithmetic mean of numeric values; Null when there is none.
Median of Number values; Null when there is none.
Distinct values in first-seen order, as a List.
Number of distinct values.
Number of rows.
First row's value, Null for no rows.
Last row's value, Null for no rows.
Build an aggregation from a fold over leaf values.
Add a merge step for child-group results.
Fold leaf values.
The merge step, if the aggregation has one.
A fold over leaf values plus an optional merge of child results.