Package io.trino.operator.aggregation
Class VarcharApproximateMostFrequent
java.lang.Object
io.trino.operator.aggregation.VarcharApproximateMostFrequent
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(VarcharApproximateMostFrequent.State state, VarcharApproximateMostFrequent.State otherState) static voidinput(VarcharApproximateMostFrequent.State state, long buckets, io.airlift.slice.Slice value, long capacity) static voidoutput(VarcharApproximateMostFrequent.State state, BlockBuilder out)
-
Method Details
-
input
public static void input(VarcharApproximateMostFrequent.State state, long buckets, io.airlift.slice.Slice value, long capacity) -
combine
public static void combine(VarcharApproximateMostFrequent.State state, VarcharApproximateMostFrequent.State otherState) -
output
-