Class OnHeapAggregateProjection
java.lang.Object
org.apache.druid.segment.incremental.OnHeapAggregateProjection
- All Implemented Interfaces:
Expr.InputBindingInspector,ColumnInspector,IncrementalIndexRowSelector
Projection of
OnheapIncrementalIndex for AggregateProjectionSpec-
Constructor Summary
ConstructorsConstructorDescriptionOnHeapAggregateProjection(AggregateProjectionSpec projectionSpec, Function<String, IncrementalIndex.DimensionDesc> getBaseTableDimensionDesc, Function<String, AggregatorFactory> getBaseTableAggregatorFactory, long minTimestamp) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddToFacts(IncrementalIndexRow key, InputRow inputRow, List<String> parseExceptionMessages, AtomicLong totalSizeInBytes) Add row to projectionfactsHolder, updating totalSizeInBytes estimategetColumnCapabilities(String column) Returns capabilities of a particular column.getColumnFormat(String columnName) GetColumnFormatfor a dimension, metrics, or time column, or null if the column does not existgetDimension(String columnName) getIncrementalIndex.DimensionDescfor the specified column, if available, which provides access to things likeDimensionIndexerandDimensionHandleras well as column capabilities and position within the rowgetDimensionNames(boolean includeTime) Returns list of dimension names for the row selector, optionally including the time column.Returns list ofIncrementalIndex.DimensionDescfor the row selectorgetFacts()Get theFactsHoldercontaining all of theIncrementalIndexRowbacking this selectorintHighest valueIncrementalIndexRow.getRowIndex()available in this selector.GetIncrementalIndex.MetricDescwhich provides column capabilities and position in the aggregators section of the rowdoublegetMetricDoubleValue(int rowOffset, int aggOffset) floatgetMetricFloatValue(int rowOffset, int aggOffset) longgetMetricLongValue(int rowOffset, int aggOffset) Returns list of all metric column names for the row selectorgetMetricObjectValue(int rowOffset, int aggOffset) Ordering for the data in the facts tableintPosition of the time column inIncrementalIndexRowSelector.getOrdering()booleanisEmpty()Are there anyIncrementalIndexRowstored in theFactsHolder?booleanisNull(int rowOffset, int aggOffset) intnumRows()Number of rows inFactsHolderMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.druid.segment.ColumnInspector
getTypeMethods inherited from interface org.apache.druid.math.expr.Expr.InputBindingInspector
areNumeric, areNumeric, areSameTypes, areSameTypes, areScalar, areScalar, canVectorize, canVectorize
-
Constructor Details
-
OnHeapAggregateProjection
public OnHeapAggregateProjection(AggregateProjectionSpec projectionSpec, Function<String, IncrementalIndex.DimensionDesc> getBaseTableDimensionDesc, Function<String, AggregatorFactory> getBaseTableAggregatorFactory, long minTimestamp)
-
-
Method Details
-
addToFacts
public void addToFacts(IncrementalIndexRow key, InputRow inputRow, List<String> parseExceptionMessages, AtomicLong totalSizeInBytes) Add row to projectionfactsHolder, updating totalSizeInBytes estimate -
getFacts
Description copied from interface:IncrementalIndexRowSelectorGet theFactsHoldercontaining all of theIncrementalIndexRowbacking this selector- Specified by:
getFactsin interfaceIncrementalIndexRowSelector
-
getDimensions
Description copied from interface:IncrementalIndexRowSelectorReturns list ofIncrementalIndex.DimensionDescfor the row selector- Specified by:
getDimensionsin interfaceIncrementalIndexRowSelector
-
getMetricNames
Description copied from interface:IncrementalIndexRowSelectorReturns list of all metric column names for the row selector- Specified by:
getMetricNamesin interfaceIncrementalIndexRowSelector
-
getDimension
Description copied from interface:IncrementalIndexRowSelectorgetIncrementalIndex.DimensionDescfor the specified column, if available, which provides access to things likeDimensionIndexerandDimensionHandleras well as column capabilities and position within the row- Specified by:
getDimensionin interfaceIncrementalIndexRowSelector
-
getMetric
Description copied from interface:IncrementalIndexRowSelectorGetIncrementalIndex.MetricDescwhich provides column capabilities and position in the aggregators section of the row- Specified by:
getMetricin interfaceIncrementalIndexRowSelector
-
getOrdering
Description copied from interface:IncrementalIndexRowSelectorOrdering for the data in the facts table- Specified by:
getOrderingin interfaceIncrementalIndexRowSelector
-
getTimePosition
public int getTimePosition()Description copied from interface:IncrementalIndexRowSelectorPosition of the time column inIncrementalIndexRowSelector.getOrdering()- Specified by:
getTimePositionin interfaceIncrementalIndexRowSelector
-
isEmpty
public boolean isEmpty()Description copied from interface:IncrementalIndexRowSelectorAre there anyIncrementalIndexRowstored in theFactsHolder?- Specified by:
isEmptyin interfaceIncrementalIndexRowSelector
-
getLastRowIndex
public int getLastRowIndex()Description copied from interface:IncrementalIndexRowSelectorHighest valueIncrementalIndexRow.getRowIndex()available in this selector. Note that these values do not reflect the position of the row in theFactsHolder, rather just the order in which they were processed- Specified by:
getLastRowIndexin interfaceIncrementalIndexRowSelector
-
getMetricFloatValue
public float getMetricFloatValue(int rowOffset, int aggOffset) - Specified by:
getMetricFloatValuein interfaceIncrementalIndexRowSelector- Parameters:
rowOffset- row to get float aggregator valueaggOffset- position of the aggregator in the aggregators array of the data schema- Returns:
- float value of the metric
-
getMetricLongValue
public long getMetricLongValue(int rowOffset, int aggOffset) - Specified by:
getMetricLongValuein interfaceIncrementalIndexRowSelector- Parameters:
rowOffset- row to get long aggregator valueaggOffset- position of the aggregator in the aggregators array of the data schema- Returns:
- long value of the aggregator for this row
-
getMetricDoubleValue
public double getMetricDoubleValue(int rowOffset, int aggOffset) - Specified by:
getMetricDoubleValuein interfaceIncrementalIndexRowSelector- Parameters:
rowOffset- row to get double aggregator valueaggOffset- position of the aggregator in the aggregators array of the data schema- Returns:
- double value of the aggregator for this row
-
getMetricObjectValue
- Specified by:
getMetricObjectValuein interfaceIncrementalIndexRowSelector- Parameters:
rowOffset- row to get long aggregator valueaggOffset- position of the aggregator in the aggregators array of the data schema- Returns:
- long value of the aggregator for this row
-
isNull
public boolean isNull(int rowOffset, int aggOffset) - Specified by:
isNullin interfaceIncrementalIndexRowSelector- Parameters:
rowOffset- row to check for a aggregator valueaggOffset- position of the aggregator in the aggregators array of the data schema- Returns:
- is the value null for this row?
-
getColumnFormat
Description copied from interface:IncrementalIndexRowSelectorGetColumnFormatfor a dimension, metrics, or time column, or null if the column does not exist- Specified by:
getColumnFormatin interfaceIncrementalIndexRowSelector
-
numRows
public int numRows()Description copied from interface:IncrementalIndexRowSelectorNumber of rows inFactsHolder- Specified by:
numRowsin interfaceIncrementalIndexRowSelector
-
getDimensionNames
Description copied from interface:IncrementalIndexRowSelectorReturns list of dimension names for the row selector, optionally including the time column. If time is included, the order columns appear in this list will matchIncrementalIndexRowSelector.getOrdering()- Specified by:
getDimensionNamesin interfaceIncrementalIndexRowSelector
-
getColumnCapabilities
Description copied from interface:ColumnInspectorReturns capabilities of a particular column.- Specified by:
getColumnCapabilitiesin interfaceColumnInspector- Parameters:
column- column name- Returns:
- capabilities, or null
-
getDimensionsMap
-
toMetadata
-