Class JavaScriptPostAggregator
- java.lang.Object
-
- org.apache.druid.query.aggregation.post.JavaScriptPostAggregator
-
- All Implemented Interfaces:
Cacheable,PostAggregator
public class JavaScriptPostAggregator extends Object implements PostAggregator
-
-
Constructor Summary
Constructors Constructor Description JavaScriptPostAggregator(String name, List<String> fieldNames, String function, JavaScriptConfig config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectcompute(Map<String,Object> combinedAggregators)JavaScriptPostAggregatordecorate(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()Set<String>getDependentFields()List<String>getFieldNames()StringgetFunction()StringgetName()ColumnTypegetType(ColumnInspector signature)Return the output type of a row processed with this post aggregator.inthashCode()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.druid.query.aggregation.PostAggregator
getType
-
-
-
-
Constructor Detail
-
JavaScriptPostAggregator
public JavaScriptPostAggregator(String name, List<String> fieldNames, String function, JavaScriptConfig config)
-
-
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
-
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
-
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 JavaScriptPostAggregator 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
-
getFunction
public String getFunction()
-
-