Class KeyMappingMultiValueGroupByColumnSelectorStrategy.DictionaryBuilding

java.lang.Object
org.apache.druid.query.groupby.epinephelinae.column.KeyMappingMultiValueGroupByColumnSelectorStrategy
org.apache.druid.query.groupby.epinephelinae.column.KeyMappingMultiValueGroupByColumnSelectorStrategy.DictionaryBuilding
All Implemented Interfaces:
ColumnSelectorStrategy, GroupByColumnSelectorStrategy
Enclosing class:
KeyMappingMultiValueGroupByColumnSelectorStrategy

public static class KeyMappingMultiValueGroupByColumnSelectorStrategy.DictionaryBuilding extends KeyMappingMultiValueGroupByColumnSelectorStrategy
  • Constructor Details

    • DictionaryBuilding

      public DictionaryBuilding()
  • Method Details

    • processValueFromGroupingKey

      public void processValueFromGroupingKey(GroupByColumnSelectorPlus selectorPlus, ByteBuffer key, ResultRow resultRow, int keyBufferPosition)
      Description copied from interface: GroupByColumnSelectorStrategy
      Read a value from a grouping key and add it to the group by query result row, using the output name specified in a DimensionSpec. An implementation may choose to not add anything to the result row (e.g., as the String implementation does for empty rows) selectorPlus provides access to: - the keyBufferPosition offset from which to read the value - the dimension value selector - the DimensionSpec for this dimension from the query
      Parameters:
      selectorPlus - dimension info containing the key offset, value selector, and dimension spec
      key - grouping key
      resultRow - result row for the group by query being served
      keyBufferPosition - buffer position for the grouping key, added to support chaining multiple ColumnSelectorStrategy
    • initColumnValues

      public int initColumnValues(ColumnValueSelector selector, int columnIndex, Object[] valuess)
      Description copied from interface: GroupByColumnSelectorStrategy
      Retrieve a row object from the ColumnValueSelector and put it in valuess at columnIndex.
      Parameters:
      selector - Value selector for a column.
      columnIndex - Index of the column within the row values array
      valuess - Row values array, one index per column
      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.
    • writeToKeyBuffer

      public int writeToKeyBuffer(int keyBufferPosition, ColumnValueSelector selector, ByteBuffer keyBuffer)
      Description copied from interface: GroupByColumnSelectorStrategy
      Write a single object from the given selector to the keyBuffer at keyBufferPosition. The reading column must have a single value. The position of the keyBuffer may be modified.
      Parameters:
      keyBufferPosition - starting offset for this column's value within the grouping key
      selector - selector to retrieve row value object from
      keyBuffer - grouping key
      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.
    • bufferComparator

      public Grouper.BufferComparator bufferComparator(int keyBufferPosition, @Nullable StringComparator stringComparator)
      Description copied from interface: GroupByColumnSelectorStrategy
      Return BufferComparator for values written using this strategy when limit is pushed down to segment scan.
      Parameters:
      keyBufferPosition - starting offset for this column's value within the grouping key
      stringComparator - stringComparator from LimitSpec for this column. If this is null, implementations will use the StringComparators.LEXICOGRAPHIC comparator.
      Returns:
      BufferComparator for comparing values written
    • reset

      public void reset()
      Description copied from interface: GroupByColumnSelectorStrategy
      Reset any internal state held by this selector. After this method is called, any row objects or key objects generated by any methods of this class must be considered unreadable. Calling GroupByColumnSelectorStrategy.processValueFromGroupingKey(org.apache.druid.query.groupby.epinephelinae.column.GroupByColumnSelectorPlus, java.nio.ByteBuffer, org.apache.druid.query.groupby.ResultRow, int) on that memory has undefined behavior.