Class ApproximateMostFrequentHistogram<K>

java.lang.Object
io.trino.operator.aggregation.ApproximateMostFrequentHistogram<K>

public class ApproximateMostFrequentHistogram<K> extends Object
Calculate the histogram approximately for topk elements based on the Space-Saving algorithm and the Stream-Summary data structure as described in: Efficient Computation of Frequent and Top-k Elements in Data Streams by Metwally, Agrawal, and Abbadi
  • Constructor Details

  • Method Details

    • add

      public void add(K value)
    • add

      public void add(K value, long incrementCount)
    • serialize

      public io.airlift.slice.Slice serialize()
    • merge

      public void merge(ApproximateMostFrequentHistogram<K> other)
    • forEachBucket

      public void forEachBucket(BucketConsumer<K> consumer)
    • getBuckets

      public Map<K,Long> getBuckets()
    • estimatedInMemorySize

      public long estimatedInMemorySize()