Class StringFirstFoldingAggregatorFactory
- java.lang.Object
-
- org.apache.druid.query.aggregation.AggregatorFactory
-
- org.apache.druid.query.aggregation.first.StringFirstAggregatorFactory
-
- org.apache.druid.query.aggregation.first.StringFirstFoldingAggregatorFactory
-
- All Implemented Interfaces:
Cacheable
public class StringFirstFoldingAggregatorFactory extends StringFirstAggregatorFactory
For backwards compatibility; equivalent to a regular StringFirstAggregatorFactory.
-
-
Field Summary
-
Fields inherited from class org.apache.druid.query.aggregation.first.StringFirstAggregatorFactory
DEFAULT_MAX_STRING_SIZE, maxStringBytes, NIL_VECTOR_AGGREGATOR, TIME_COMPARATOR, TYPE, VALUE_COMPARATOR
-
-
Constructor Summary
Constructors Constructor Description StringFirstFoldingAggregatorFactory(String name, String fieldName, Integer maxStringBytes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AggregatorFactory
withName(String newName)
Used in cases where we want to change the output name of the aggregator to something else.-
Methods inherited from class org.apache.druid.query.aggregation.first.StringFirstAggregatorFactory
canVectorize, combine, deserialize, equals, factorize, factorizeBuffered, factorizeVector, finalizeComputation, getCacheKey, getCombiningFactory, getComparator, getFieldName, getIntermediateType, getMaxIntermediateSize, getMaxStringBytes, getName, getResultType, getTimeColumn, hashCode, makeAggregateCombiner, requiredFields, toString
-
Methods inherited from class org.apache.druid.query.aggregation.AggregatorFactory
factorizeWithSize, getComplexTypeName, getFinalizedType, getMaxIntermediateSizeWithNulls, getMergingFactory, getRequiredColumns, getType, guessAggregatorHeapFootprint, makeNullableAggregateCombiner, mergeAggregators, optimizeForSegment
-
-
-
-
Method Detail
-
withName
public AggregatorFactory withName(String newName)
Description copied from class:AggregatorFactory
Used in cases where we want to change the output name of the aggregator to something else. For eg: if we have a query `select a, sum(b) as total group by a from table` the aggregator returned from the native group by query is "a0" set inorg.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.
- Overrides:
withName
in classStringFirstAggregatorFactory
- Parameters:
newName
- newName of the output for aggregator factory- Returns:
- AggregatorFactory with the output name set as the input param.
-
-