Interface GroupByVectorColumnSelector
-
- All Known Implementing Classes:
DictionaryBuildingSingleValueStringGroupByVectorColumnSelector
,DoubleGroupByVectorColumnSelector
,FloatGroupByVectorColumnSelector
,LongGroupByVectorColumnSelector
,NilGroupByVectorColumnSelector
,NullableDoubleGroupByVectorColumnSelector
,NullableFloatGroupByVectorColumnSelector
,NullableLongGroupByVectorColumnSelector
,SingleValueStringGroupByVectorColumnSelector
public interface GroupByVectorColumnSelector
Column processor for groupBy dimensions. Processors may have internal state, such as the dictionary maintained byDictionaryBuildingSingleValueStringGroupByVectorColumnSelector
. Callers should assume that the internal state footprint starts out empty (zero bytes) and is also reset to zero on each call toreset()
. Each call towriteKeys(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.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
getGroupingKeySize()
Get the size in bytes of the key parts generated by this column.void
reset()
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.
-
-
-
Method Detail
-
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 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
void writeKeyToResultRow(MemoryPointer keyMemory, int keyOffset, ResultRow resultRow, int resultRowPosition)
Write key parts for this column into a particular result row.- 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
void reset()
Reset any internal state held by this selector. After this method is called, any memory previously written bywriteKeys(org.apache.datasketches.memory.WritableMemory, int, int, int, int)
must be considered unreadable. CallingwriteKeyToResultRow(org.apache.druid.query.groupby.epinephelinae.collection.MemoryPointer, int, org.apache.druid.query.groupby.ResultRow, int)
on that memory has undefined behavior.
-
-