Interface GroupByVectorColumnSelector

All Superinterfaces:
GroupingSelector
All Known Implementing Classes:
DictionaryBuildingSingleValueStringGroupByVectorColumnSelector, DoubleGroupByVectorColumnSelector, ExpressionDeferredGroupByVectorColumnSelector, FloatGroupByVectorColumnSelector, LongGroupByVectorColumnSelector, NilGroupByVectorColumnSelector, NullableDoubleGroupByVectorColumnSelector, NullableFloatGroupByVectorColumnSelector, NullableLongGroupByVectorColumnSelector, SingleValueStringGroupByVectorColumnSelector

public interface GroupByVectorColumnSelector extends GroupingSelector
Column processor for groupBy dimensions. Processors may have internal state, such as the dictionary maintained by DictionaryBuildingSingleValueStringGroupByVectorColumnSelector. Callers should assume that the internal state footprint starts out empty (zero bytes) and is also reset to zero on each call to reset(). Each call to writeKeys(org.apache.datasketches.memory.WritableMemory, int, int, int, int) returns the incremental increase in internal state footprint that happened as a result of that particular call.
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Get the size in bytes of the key parts generated by this column.
    void
    Reset any internal state held by this selector.
    int
    writeKeys(org.apache.datasketches.memory.WritableMemory keySpace, int keySize, int keyOffset, int startRow, int endRow)
    Write key parts for this column, from startRow (inclusive) to endRow (exclusive), into keySpace starting at keyOffset.
    void
    writeKeyToResultRow(MemoryPointer keyMemory, int keyOffset, ResultRow resultRow, int resultRowPosition)
    Write key parts for this column into a particular result row.

    Methods inherited from interface org.apache.druid.query.groupby.epinephelinae.GroupingSelector

    getValueCardinality
  • Method Details

    • getGroupingKeySize

      int getGroupingKeySize()
      Get the size in bytes of the key parts generated by this column.
    • writeKeys

      int writeKeys(org.apache.datasketches.memory.WritableMemory keySpace, int keySize, int keyOffset, int startRow, int endRow)
      Write key parts for this column, from startRow (inclusive) to endRow (exclusive), into keySpace starting at keyOffset.
      Parameters:
      keySpace - key memory
      keySize - size of the overall key (not just the part for this column)
      keyOffset - starting position for the first key part within keySpace
      startRow - starting row (inclusive) within the current vector
      endRow - ending row (exclusive) within the current vector
      Returns:
      estimated increase in internal state footprint, in bytes, as a result of this operation. May be zero if memory did not increase as a result of this operation. Will not be negative.
    • writeKeyToResultRow

      void writeKeyToResultRow(MemoryPointer keyMemory, int keyOffset, ResultRow resultRow, int resultRowPosition)
      Write key parts for this column into a particular result row.
      Parameters:
      keyMemory - key memory
      keyOffset - starting position for this key part within keyMemory (starting from MemoryPointer.position)
      resultRow - result row to receive key parts
      resultRowPosition - position within the result row for this key part
    • reset

      void reset()
      Reset any internal state held by this selector. After this method is called, any memory previously written by writeKeys(org.apache.datasketches.memory.WritableMemory, int, int, int, int) must be considered unreadable. Calling writeKeyToResultRow(org.apache.druid.query.groupby.epinephelinae.collection.MemoryPointer, int, org.apache.druid.query.groupby.ResultRow, int) on that memory has undefined behavior.