Class BufferArrayGrouper

  • All Implemented Interfaces:
    Closeable, AutoCloseable, Grouper<IntKey>, IntGrouper, VectorGrouper

    public class BufferArrayGrouper
    extends Object
    implements VectorGrouper, IntGrouper
    A buffer grouper for array-based aggregation. This grouper stores aggregated values in the buffer using the grouping key as the index.

    The buffer is divided into 2 separate regions, i.e., used flag buffer and value buffer. The used flag buffer is a bit set to represent which keys are valid. If a bit of an index is set, that key is valid. Finally, the value buffer is used to store aggregated values. The first index is reserved for GroupByColumnSelectorStrategy.GROUP_BY_MISSING_VALUE.

    This grouper is available only when the grouping key is a single indexed dimension of a known cardinality because it directly uses the dimension value as the index for array access. Since the cardinality for the grouping key across different segments cannot be currently retrieved, this grouper can be used only when performing per-segment query execution.