Skip to content

rollup()

Combine multiple frequency aggregates

Since 1.16.0

Combine multiple aggregates created with freq_agg or mcv_agg functions. This function requires that the source aggregates have been created with the same parameters (same min_freq for freq_agg, same n-factor and skew, if used, for a mcv_agg).

This produces a very similar aggregate to running the same aggregate function over all the source data. In most cases, any difference is no more than what you might get from simply reordering the input. However, if the source data for the different aggregates is very differently distributed, the rollup result may have looser frequency bounds.

The syntax is:

rollup(
agg SpaceSavingAggregate
) RETURNS SpaceSavingAggregate
NameTypeDefaultRequiredDescription
aggSpaceSavingAggregate-The aggregates to roll up. These must have been created with the same parameters.
ColumnTypeDescription
rollupSpaceSavingAggregateAn aggregate containing the most common elements from all of the underlying data for all of the aggregates.