@Internal public final class CollectAggFunction<T> extends BuiltInAggregateFunction<MapData,CollectAggFunction.CollectAccumulator<T>>
Modifier and Type | Class and Description |
---|---|
static class |
CollectAggFunction.CollectAccumulator<T>
Accumulator for COLLECT.
|
Constructor and Description |
---|
CollectAggFunction(LogicalType elementType) |
Modifier and Type | Method and Description |
---|---|
void |
accumulate(CollectAggFunction.CollectAccumulator<T> accumulator,
T value) |
CollectAggFunction.CollectAccumulator<T> |
createAccumulator()
Creates and initializes the accumulator for this
ImperativeAggregateFunction . |
DataType |
getAccumulatorDataType() |
List<DataType> |
getArgumentDataTypes() |
DataType |
getOutputDataType() |
MapData |
getValue(CollectAggFunction.CollectAccumulator<T> accumulator)
Called every time when an aggregation result should be materialized.
|
void |
merge(CollectAggFunction.CollectAccumulator<T> accumulator,
Iterable<CollectAggFunction.CollectAccumulator<T>> others) |
void |
resetAccumulator(CollectAggFunction.CollectAccumulator<T> accumulator) |
void |
retract(CollectAggFunction.CollectAccumulator<T> accumulator,
T value) |
getRequirements, getTypeInference, isDeterministic
getKind
getAccumulatorType, getResultType
close, functionIdentifier, open, toString
public CollectAggFunction(LogicalType elementType)
public List<DataType> getArgumentDataTypes()
getArgumentDataTypes
in class BuiltInAggregateFunction<MapData,CollectAggFunction.CollectAccumulator<T>>
public DataType getAccumulatorDataType()
getAccumulatorDataType
in class BuiltInAggregateFunction<MapData,CollectAggFunction.CollectAccumulator<T>>
public DataType getOutputDataType()
getOutputDataType
in class BuiltInAggregateFunction<MapData,CollectAggFunction.CollectAccumulator<T>>
public CollectAggFunction.CollectAccumulator<T> createAccumulator()
ImperativeAggregateFunction
ImperativeAggregateFunction
.
The accumulator is an intermediate data structure that stores the aggregated values until a final aggregation result is computed.
createAccumulator
in class ImperativeAggregateFunction<MapData,CollectAggFunction.CollectAccumulator<T>>
public void resetAccumulator(CollectAggFunction.CollectAccumulator<T> accumulator)
public void accumulate(CollectAggFunction.CollectAccumulator<T> accumulator, T value) throws Exception
Exception
public void retract(CollectAggFunction.CollectAccumulator<T> accumulator, T value) throws Exception
Exception
public void merge(CollectAggFunction.CollectAccumulator<T> accumulator, Iterable<CollectAggFunction.CollectAccumulator<T>> others) throws Exception
Exception
public MapData getValue(CollectAggFunction.CollectAccumulator<T> accumulator)
AggregateFunction
getValue
in class AggregateFunction<MapData,CollectAggFunction.CollectAccumulator<T>>
accumulator
- the accumulator which contains the current intermediate resultsCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.