Package io.trino.operator.aggregation
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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceBigintApproximateMostFrequent.State
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcombine(BigintApproximateMostFrequent.State state, BigintApproximateMostFrequent.State otherState)static voidinput(BigintApproximateMostFrequent.State state, long buckets, long value, long capacity)static voidoutput(BigintApproximateMostFrequent.State state, BlockBuilder out)
-
-
-
Method Detail
-
input
public static void input(BigintApproximateMostFrequent.State state, long buckets, long value, long capacity)
-
combine
public static void combine(BigintApproximateMostFrequent.State state, BigintApproximateMostFrequent.State otherState)
-
output
public static void output(BigintApproximateMostFrequent.State state, BlockBuilder out)
-
-