Class DictionaryBuildingGroupByVectorColumnSelector<T>
java.lang.Object
org.apache.druid.query.groupby.epinephelinae.vector.DictionaryBuildingGroupByVectorColumnSelector<T>
- All Implemented Interfaces:
GroupingSelector,GroupByVectorColumnSelector
- Direct Known Subclasses:
DictionaryBuildingComplexGroupByVectorColumnSelector,DictionaryBuildingSingleValueStringGroupByVectorColumnSelector
public abstract class DictionaryBuildingGroupByVectorColumnSelector<T>
extends Object
implements GroupByVectorColumnSelector
Base class for
GroupByVectorColumnSelector that build dictionaries for values that are not
natively dictionary-encoded.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final DimensionIdCodec<T>protected final VectorObjectSelector -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDictionaryBuildingGroupByVectorColumnSelector(VectorObjectSelector selector, DimensionIdCodec<T> dimensionIdCodec) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract TconvertValue(Object rawValue) Convert raw value from the vector to the appropriate type for this selector.final intGet the size in bytes of the key parts generated by this column.final voidreset()Reset any internal state held by this selector.final intwriteKeys(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.final voidwriteKeyToResultRow(MemoryPointer keyMemory, int keyOffset, ResultRow resultRow, int resultRowPosition) Write key parts for this column into a particular result row.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.druid.query.groupby.epinephelinae.GroupingSelector
getValueCardinality
-
Field Details
-
selector
-
dimensionIdCodec
-
-
Constructor Details
-
DictionaryBuildingGroupByVectorColumnSelector
protected DictionaryBuildingGroupByVectorColumnSelector(VectorObjectSelector selector, DimensionIdCodec<T> dimensionIdCodec)
-
-
Method Details
-
getGroupingKeySize
public final int getGroupingKeySize()Description copied from interface:GroupByVectorColumnSelectorGet the size in bytes of the key parts generated by this column.- Specified by:
getGroupingKeySizein interfaceGroupByVectorColumnSelector
-
writeKeys
public final int writeKeys(org.apache.datasketches.memory.WritableMemory keySpace, int keySize, int keyOffset, int startRow, int endRow) Description copied from interface:GroupByVectorColumnSelectorWrite key parts for this column, from startRow (inclusive) to endRow (exclusive), into keySpace starting at keyOffset.- Specified by:
writeKeysin interfaceGroupByVectorColumnSelector- Parameters:
keySpace- key memorykeySize- size of the overall key (not just the part for this column)keyOffset- starting position for the first key part within keySpacestartRow- starting row (inclusive) within the current vectorendRow- 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
public final void writeKeyToResultRow(MemoryPointer keyMemory, int keyOffset, ResultRow resultRow, int resultRowPosition) Description copied from interface:GroupByVectorColumnSelectorWrite key parts for this column into a particular result row.- Specified by:
writeKeyToResultRowin interfaceGroupByVectorColumnSelector- Parameters:
keyMemory- key memorykeyOffset- starting position for this key part within keyMemory (starting fromMemoryPointer.position)resultRow- result row to receive key partsresultRowPosition- position within the result row for this key part
-
reset
public final void reset()Description copied from interface:GroupByVectorColumnSelectorReset any internal state held by this selector. After this method is called, any memory previously written byGroupByVectorColumnSelector.writeKeys(org.apache.datasketches.memory.WritableMemory, int, int, int, int)must be considered unreadable. CallingGroupByVectorColumnSelector.writeKeyToResultRow(org.apache.druid.query.groupby.epinephelinae.collection.MemoryPointer, int, org.apache.druid.query.groupby.ResultRow, int)on that memory has undefined behavior.- Specified by:
resetin interfaceGroupByVectorColumnSelector
-
convertValue
Convert raw value from the vector to the appropriate type for this selector.
-