Class ConstantPostAggregator
- java.lang.Object
-
- org.apache.druid.query.aggregation.post.ConstantPostAggregator
-
- All Implemented Interfaces:
Cacheable,PostAggregator
public class ConstantPostAggregator extends Object implements PostAggregator
-
-
Constructor Summary
Constructors Constructor Description ConstantPostAggregator(String name, Number constantValue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectcompute(Map<String,Object> combinedAggregators)ConstantPostAggregatordecorate(Map<String,AggregatorFactory> aggregators)Allows returning an enriched post aggregator, built from contextual information available from the given map ofAggregatorFactorykeyed by their names.booleanequals(Object o)byte[]getCacheKey()Get a byte array used as a cache key.ComparatorgetComparator()NumbergetConstantValue()Set<String>getDependentFields()StringgetName()ColumnTypegetType(ColumnInspector signature)Return the output type of a row processed with this post aggregator.inthashCode()StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.druid.query.aggregation.PostAggregator
getType
-
-
-
-
Method Detail
-
getDependentFields
public Set<String> getDependentFields()
- Specified by:
getDependentFieldsin interfacePostAggregator
-
getComparator
public Comparator getComparator()
- Specified by:
getComparatorin interfacePostAggregator
-
compute
public Object compute(Map<String,Object> combinedAggregators)
- Specified by:
computein interfacePostAggregator
-
getName
public String getName()
- Specified by:
getNamein interfacePostAggregator
-
getType
public ColumnType getType(ColumnInspector signature)
Description copied from interface:PostAggregatorReturn the output type of a row processed with this post aggregator. Refer to theColumnTypejavadocs for details on the implications of choosing a type.- Specified by:
getTypein interfacePostAggregator
-
decorate
public ConstantPostAggregator decorate(Map<String,AggregatorFactory> aggregators)
Description copied from interface:PostAggregatorAllows returning an enriched post aggregator, built from contextual information available from the given map ofAggregatorFactorykeyed by their names. Callers must call this method before callingPostAggregator.compute(java.util.Map<java.lang.String, java.lang.Object>)orPostAggregator.getComparator(). This is typically done in the constructor of queries which support post aggregators, viaQueries.prepareAggregations(java.util.List<org.apache.druid.query.aggregation.AggregatorFactory>, java.util.List<org.apache.druid.query.aggregation.PostAggregator>).- Specified by:
decoratein interfacePostAggregator
-
getConstantValue
public Number getConstantValue()
-
getCacheKey
public byte[] getCacheKey()
Description copied from interface:CacheableGet a byte array used as a cache key.- Specified by:
getCacheKeyin interfaceCacheable- Returns:
- a cache key
-
-