Package io.trino.operator.aggregation
Class BigintApproximateMostFrequent
java.lang.Object
io.trino.operator.aggregation.BigintApproximateMostFrequent
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic 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 Details
-
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
-