Aggregate data into a space-saving aggregate, which stores frequency information in an intermediate form. You can then
use any of the accessors in this group to return estimated frequencies or the most common elements.
This differs from freq_agg in that you can specify a target number of values for topn() to return, rather than a frequency cutoff.
The target number of most-frequent values. Must be greater than 0.
value
BIGINT | TEXT
-
✔
The column to store frequencies for
skew
DOUBLE PRECISION
1.1
The estimated skew of the data, defined as the s parameter of a zeta distribution. Must be greater than 1.0. Defaults to 1.1. For more information, see the section on skew.
An object storing the most common elements of the given table and their estimated frequency. The exact type is SpaceSavingBigIntAggregate or SpaceSavingTextAggregate depending on the input type. You can pass this object to any of the accessor functions to get a final result.