Class BigintApproximateMostFrequent

java.lang.Object
io.trino.operator.aggregation.BigintApproximateMostFrequent

public final class BigintApproximateMostFrequent extends Object

Aggregation function that approximates the frequency of the top-K elements. This function keeps counts for a "frequent" subset of elements and assumes all other elements once fewer than the least-frequent "frequent" element.

The algorithm is based loosely on: Efficient Computation of Frequent and Top-*k* Elements in Data Streams by Ahmed Metwally, Divyakant Agrawal, and Amr El Abbadi