Interface VectorAggregator
-
- All Known Implementing Classes:
CardinalityVectorAggregator
,CountVectorAggregator
,DoubleAnyVectorAggregator
,DoubleFirstVectorAggregator
,DoubleLastVectorAggregator
,DoubleMaxVectorAggregator
,DoubleMeanVectorAggregator
,DoubleMinVectorAggregator
,DoubleSumVectorAggregator
,FilteredVectorAggregator
,FloatAnyVectorAggregator
,FloatFirstVectorAggregator
,FloatLastVectorAggregator
,FloatMaxVectorAggregator
,FloatMinVectorAggregator
,FloatSumVectorAggregator
,HyperUniquesVectorAggregator
,LongAnyVectorAggregator
,LongConstantVectorAggregator
,LongFirstVectorAggregator
,LongLastVectorAggregator
,LongMaxVectorAggregator
,LongMinVectorAggregator
,LongSumVectorAggregator
,NilVectorAggregator
,NoopVectorAggregator
,NullableNumericVectorAggregator
,NumericAnyVectorAggregator
,NumericFirstVectorAggregator
,NumericLastVectorAggregator
,SingleStringFirstDimensionVectorAggregator
,SingleStringLastDimensionVectorAggregator
,StringAnyVectorAggregator
,StringFirstVectorAggregator
,StringLastVectorAggregator
,SuppressedAggregatorFactory.SuppressedVectorAggregator
public interface VectorAggregator
An object that can aggregate metrics into a ByteBuffer, from vectorized column selectors. Its aggregation-related methods (namely, "aggregate" and "get") do not take the actual input values to aggregate, because it is assumed that the VectorAggregator was given something that it can use to get at the current batch of data. None of the methods in this class are annotated withCalledFromHotLoop
because vectorized query engines do not use monomorphic-processing-style specialization. UnlikeAggregator
, VectorAggregators are never used by multiple threads at once. Implementations are not required to be thread safe.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
aggregate(ByteBuffer buf, int numRows, int[] positions, int[] rows, int positionOffset)
Aggregate a list of rows ("rows") into a list of aggregation slots ("positions").void
aggregate(ByteBuffer buf, int position, int startRow, int endRow)
Aggregate a range of rows into a single aggregation slot.void
close()
Release any resources used by the aggregator.Object
get(ByteBuffer buf, int position)
void
init(ByteBuffer buf, int position)
default void
relocate(int oldPosition, int newPosition, ByteBuffer oldBuffer, ByteBuffer newBuffer)
-
-
-
Method Detail
-
init
void init(ByteBuffer buf, int position)
-
aggregate
void aggregate(ByteBuffer buf, int position, int startRow, int endRow)
Aggregate a range of rows into a single aggregation slot. Implementations must not change the position, limit or mark of the given buffer- Parameters:
buf
- byte buffer storing the byte array representation of the aggregateposition
- offset within the byte buffer at which the current aggregate value is storedstartRow
- first row of the range within the current batch to aggregate (inclusive)endRow
- end row of the range (exclusive)
-
aggregate
void aggregate(ByteBuffer buf, int numRows, int[] positions, @Nullable int[] rows, int positionOffset)
Aggregate a list of rows ("rows") into a list of aggregation slots ("positions"). Implementations must not change the position, limit or mark of the given buffer- Parameters:
buf
- byte buffer storing the byte array representation of the aggregatenumRows
- number of rows to aggregatepositions
- array of aggregate value positions within the buffer; must be at least as long as "numRows"rows
- array of row numbers within the current row batch; must be at least as long as "numRows". If null, the aggregator will aggregate rows from 0 (inclusive) to numRows (exclusive).positionOffset
- an offset to apply to each value from "positions"
-
get
@Nullable Object get(ByteBuffer buf, int position)
-
relocate
default void relocate(int oldPosition, int newPosition, ByteBuffer oldBuffer, ByteBuffer newBuffer)
-
close
void close()
Release any resources used by the aggregator.
-
-