public final class ApproximateMostFrequent extends SqlAggregationFunction
Aggregation function that computes the top-K frequent elements approximately. Approximate estimation of the function enables us to pick up the frequent values with less memory. Larger input "capacity" improves the accuracy of underlying algorithm with sacrificing the memory capacity.
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
Modifier and Type | Field and Description |
---|---|
static ApproximateMostFrequent |
APPROXIMATE_MOST_FREQUENT |
static String |
NAME |
Modifier | Constructor and Description |
---|---|
protected |
ApproximateMostFrequent() |
Modifier and Type | Method and Description |
---|---|
static void |
combine(ApproximateMostFrequentState state,
ApproximateMostFrequentState otherState) |
String |
getDescription() |
static void |
input(Type type,
ApproximateMostFrequentState state,
long buckets,
Block valueBlock,
int valueIndex,
long capacity) |
static void |
output(ApproximateMostFrequentState state,
BlockBuilder out) |
BuiltInAggregationFunctionImplementation |
specialize(BoundVariables boundVariables,
int arity,
FunctionAndTypeManager functionAndTypeManager) |
createFunctionByAnnotations, createFunctionsByAnnotations, getSignature, getVisibility, isDeterministic
isCalledOnNullInput
public static final ApproximateMostFrequent APPROXIMATE_MOST_FREQUENT
public static final String NAME
public BuiltInAggregationFunctionImplementation specialize(BoundVariables boundVariables, int arity, FunctionAndTypeManager functionAndTypeManager)
specialize
in class SqlAggregationFunction
public String getDescription()
public static void input(Type type, ApproximateMostFrequentState state, long buckets, Block valueBlock, int valueIndex, long capacity)
public static void combine(ApproximateMostFrequentState state, ApproximateMostFrequentState otherState)
public static void output(ApproximateMostFrequentState state, BlockBuilder out)
Copyright © 2012–2022. All rights reserved.