public class HistogramAggregatorFactory extends AggregatorFactory
| Modifier and Type | Field and Description |
|---|---|
static ColumnType |
TYPE |
static ColumnType |
TYPE_VISUAL |
| Constructor and Description |
|---|
HistogramAggregatorFactory(String name,
String fieldName,
List<Float> breaksList) |
| Modifier and Type | Method and Description |
|---|---|
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). |
Object |
deserialize(Object object)
A method that knows how to "deserialize" the object from whatever form it might have been put into
in order to transfer via JSON.
|
boolean |
equals(Object o) |
Aggregator |
factorize(ColumnSelectorFactory metricFactory) |
BufferAggregator |
factorizeBuffered(ColumnSelectorFactory metricFactory) |
Object |
finalizeComputation(Object object)
"Finalizes" the computation of an object.
|
List<Float> |
getBreaks() |
byte[] |
getCacheKey()
Get a byte array used as a cache key.
|
AggregatorFactory |
getCombiningFactory()
Returns an AggregatorFactory that can be used to combine the output of aggregators from this factory.
|
Comparator |
getComparator() |
String |
getFieldName() |
ColumnType |
getIntermediateType()
actual type is
Histogram |
int |
getMaxIntermediateSize()
Returns the maximum size that this aggregator will require in bytes for intermediate storage of results.
|
String |
getName() |
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. |
ColumnType |
getResultType()
actual type is
HistogramVisual |
int |
hashCode() |
AggregateCombiner |
makeAggregateCombiner()
Creates an AggregateCombiner to fold rollup aggregation results from serveral "rows" of different indexes during
index merging.
|
List<String> |
requiredFields()
Get a list of fields that aggregators built by this factory will need to read.
|
String |
toString() |
AggregatorFactory |
withName(String newName)
Used in cases where we want to change the output name of the aggregator to something else.
|
canVectorize, factorizeVector, factorizeWithSize, getComplexTypeName, getFinalizedType, getMaxIntermediateSizeWithNulls, getMergingFactory, getType, guessAggregatorHeapFootprint, makeNullableAggregateCombiner, mergeAggregators, optimizeForSegmentpublic static final ColumnType TYPE
public static final ColumnType TYPE_VISUAL
public Aggregator factorize(ColumnSelectorFactory metricFactory)
factorize in class AggregatorFactorypublic BufferAggregator factorizeBuffered(ColumnSelectorFactory metricFactory)
factorizeBuffered in class AggregatorFactorypublic Comparator getComparator()
getComparator in class AggregatorFactorypublic Object combine(Object lhs, Object rhs)
AggregatorFactoryAggregator.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 AggregatorFactorylhs - The left hand side of the combinerhs - The right hand side of the combinepublic AggregateCombiner makeAggregateCombiner()
AggregatorFactoryAggregatorFactory.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 AggregatorFactoryAggregateCombiner,
IndexMergerpublic AggregatorFactory getCombiningFactory()
AggregatorFactoryCountAggregatorFactory 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 AggregatorFactorypublic List<AggregatorFactory> getRequiredColumns()
AggregatorFactoryGroupByStrategyV1 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 AggregatorFactorya similarly-named method that is perhaps the one you want instead.public Object deserialize(Object object)
AggregatorFactorydeserialize in class AggregatorFactoryobject - the object to deserialize@Nullable public Object finalizeComputation(@Nullable Object object)
AggregatorFactoryfinalizeComputation in class AggregatorFactoryobject - the object to be finalizedpublic String getName()
getName in class AggregatorFactorypublic String getFieldName()
public List<String> requiredFields()
AggregatorFactoryrequiredFields in class AggregatorFactorypublic byte[] getCacheKey()
Cacheablepublic ColumnType getIntermediateType()
HistogramgetIntermediateType in class AggregatorFactorypublic ColumnType getResultType()
HistogramVisualgetResultType in class AggregatorFactorypublic int getMaxIntermediateSize()
AggregatorFactorygetMaxIntermediateSize in class AggregatorFactorypublic AggregatorFactory withName(String newName)
AggregatorFactoryorg.apache.druid.sql.calcite.rel.DruidQuery#computeAggregations. We can use withName("total") to set the output name
of the aggregator to "total".
As all implementations of this interface method may not exist, callers of this method are advised to handle such a case.
withName in class AggregatorFactorynewName - newName of the output for aggregator factoryCopyright © 2011–2023 The Apache Software Foundation. All rights reserved.