public class DoubleSumAggregatorFactory extends SimpleDoubleAggregatorFactory
expression, fieldExpression, fieldName, macroTable, name, storeDoubleAsFloat
Constructor and Description |
---|
DoubleSumAggregatorFactory(String name,
String fieldName) |
DoubleSumAggregatorFactory(String name,
String fieldName,
String expression,
ExprMacroTable macroTable) |
Modifier and Type | Method and Description |
---|---|
protected Aggregator |
buildAggregator(BaseDoubleColumnValueSelector selector) |
protected BufferAggregator |
buildBufferAggregator(BaseDoubleColumnValueSelector selector) |
Object |
combine(Object lhs,
Object rhs)
A method that knows how to combine the outputs of
Aggregator.get() produced via AggregatorFactory.factorize(org.apache.druid.segment.ColumnSelectorFactory) or BufferAggregator.get(java.nio.ByteBuffer, int) produced via AggregatorFactory.factorizeBuffered(org.apache.druid.segment.ColumnSelectorFactory) . |
protected VectorAggregator |
factorizeVector(VectorColumnSelectorFactory columnSelectorFactory,
VectorValueSelector selector)
Creates a
VectorAggregator to aggregate values from several rows into a ByteBuffer. |
byte[] |
getCacheKey() |
AggregatorFactory |
getCombiningFactory()
Returns an AggregatorFactory that can be used to combine the output of aggregators from this factory.
|
List<AggregatorFactory> |
getRequiredColumns()
Used by
GroupByStrategyV1 when running nested groupBys, to
"transfer" values from this aggreagtor to an incremental index that the outer query will run on. |
AggregateCombiner |
makeAggregateCombiner()
Creates an AggregateCombiner to fold rollup aggregation results from serveral "rows" of different indexes during
index merging.
|
protected double |
nullValue() |
String |
toString() |
canVectorize, deserialize, equals, factorize, factorizeBuffered, finalizeComputation, getComparator, getExpression, getFieldName, getMaxIntermediateSize, getMergingFactory, getName, getType, hashCode, requiredFields, selector, vectorSelector
factorize, factorizeBuffered, factorizeVector, getFinalizedType, getMaxIntermediateSizeWithNulls, makeNullableAggregateCombiner
getComplexTypeName, mergeAggregators, optimizeForSegment
public DoubleSumAggregatorFactory(String name, String fieldName, @Nullable String expression, ExprMacroTable macroTable)
protected double nullValue()
nullValue
in class SimpleDoubleAggregatorFactory
protected Aggregator buildAggregator(BaseDoubleColumnValueSelector selector)
buildAggregator
in class SimpleDoubleAggregatorFactory
protected BufferAggregator buildBufferAggregator(BaseDoubleColumnValueSelector selector)
buildBufferAggregator
in class SimpleDoubleAggregatorFactory
protected VectorAggregator factorizeVector(VectorColumnSelectorFactory columnSelectorFactory, VectorValueSelector selector)
NullableNumericAggregatorFactory
VectorAggregator
to aggregate values from several rows into a ByteBuffer.factorizeVector
in class NullableNumericAggregatorFactory<ColumnValueSelector>
columnSelectorFactory
- columnSelectorFactory in case any other columns are needed.selector
- VectorValueSelector
for the column to aggregate.BufferAggregator
@Nullable public Object combine(@Nullable Object lhs, @Nullable Object rhs)
AggregatorFactory
Aggregator.get()
produced via AggregatorFactory.factorize(org.apache.druid.segment.ColumnSelectorFactory)
or BufferAggregator.get(java.nio.ByteBuffer, int)
produced via AggregatorFactory.factorizeBuffered(org.apache.druid.segment.ColumnSelectorFactory)
. Note, even though this method is called "combine",
this method's contract *does* allow for mutation of the input objects. Thus, any use of lhs or rhs after calling
this method is highly discouraged.combine
in class AggregatorFactory
lhs
- The left hand side of the combinerhs
- The right hand side of the combinepublic AggregateCombiner makeAggregateCombiner()
AggregatorFactory
AggregatorFactory.combine(java.lang.Object, java.lang.Object)
, with the difference that it uses
ColumnValueSelector
and it's subinterfaces to get inputs and implements ColumnValueSelector
to provide output.makeAggregateCombiner
in class AggregatorFactory
AggregateCombiner
,
IndexMerger
public AggregatorFactory getCombiningFactory()
AggregatorFactory
CountAggregatorFactory
getCombiningFactory method will return a
LongSumAggregatorFactory
, because counts are combined by summing.
No matter what, `foo.getCombiningFactory()` and `foo.getCombiningFactory().getCombiningFactory()` should return
the same result.getCombiningFactory
in class AggregatorFactory
public List<AggregatorFactory> getRequiredColumns()
AggregatorFactory
GroupByStrategyV1
when running nested groupBys, to
"transfer" values from this aggreagtor to an incremental index that the outer query will run on. This method
only exists due to the design of GroupByStrategyV1, and should probably not be used for anything else. If you are
here because you are looking for a way to get the input fields required by this aggregator, and thought
"getRequiredColumns" sounded right, please use AggregatorFactory.requiredFields()
instead.getRequiredColumns
in class AggregatorFactory
a similarly-named method that is perhaps the one you want instead.
public byte[] getCacheKey()
Copyright © 2011–2021 The Apache Software Foundation. All rights reserved.