Class ExpressionPostAggregator
- java.lang.Object
-
- org.apache.druid.query.aggregation.post.ExpressionPostAggregator
-
- All Implemented Interfaces:
Cacheable
,PostAggregator
public class ExpressionPostAggregator extends Object implements PostAggregator
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ExpressionPostAggregator.Ordering
-
Constructor Summary
Constructors Constructor Description ExpressionPostAggregator(String name, String expression, String ordering, ColumnType outputType, Expr parsed)
Constructor for a pre-parsed expression.ExpressionPostAggregator(String name, String expression, String ordering, ColumnType outputType, ExprMacroTable macroTable)
Constructor for deserialization.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
compute(Map<String,Object> values)
ExpressionPostAggregator
decorate(Map<String,AggregatorFactory> aggregators)
Allows returning an enriched post aggregator, built from contextual information available from the given map ofAggregatorFactory
keyed by their names.boolean
equals(Object o)
byte[]
getCacheKey()
Get a byte array used as a cache key.Comparator
getComparator()
Set<String>
getDependentFields()
String
getExpression()
String
getName()
String
getOrdering()
ColumnType
getOutputType()
ColumnType
getType(ColumnInspector signature)
Return the output type of a row processed with this post aggregator.int
hashCode()
String
toString()
-
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
-
-
-
-
Constructor Detail
-
ExpressionPostAggregator
public ExpressionPostAggregator(String name, String expression, @Nullable String ordering, @Nullable ColumnType outputType, ExprMacroTable macroTable)
Constructor for deserialization.
-
-
Method Detail
-
getDependentFields
public Set<String> getDependentFields()
- Specified by:
getDependentFields
in interfacePostAggregator
-
getComparator
public Comparator getComparator()
- Specified by:
getComparator
in interfacePostAggregator
-
compute
public Object compute(Map<String,Object> values)
- Specified by:
compute
in interfacePostAggregator
-
getName
public String getName()
- Specified by:
getName
in interfacePostAggregator
-
getType
public ColumnType getType(ColumnInspector signature)
Description copied from interface:PostAggregator
Return the output type of a row processed with this post aggregator. Refer to theColumnType
javadocs for details on the implications of choosing a type.- Specified by:
getType
in interfacePostAggregator
-
decorate
public ExpressionPostAggregator decorate(Map<String,AggregatorFactory> aggregators)
Description copied from interface:PostAggregator
Allows returning an enriched post aggregator, built from contextual information available from the given map ofAggregatorFactory
keyed 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:
decorate
in interfacePostAggregator
-
getExpression
public String getExpression()
-
getOutputType
@Nullable public ColumnType getOutputType()
-
getCacheKey
public byte[] getCacheKey()
Description copied from interface:Cacheable
Get a byte array used as a cache key.- Specified by:
getCacheKey
in interfaceCacheable
- Returns:
- a cache key
-
-