@Internal public final class CollectAggFunction<T> extends InternalAggregateFunction<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() |
DataType[] |
getInputDataTypes() |
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) |
getTypeInference
getKind
getAccumulatorType, getResultType
close, functionIdentifier, open, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getRequirements, isDeterministic
public CollectAggFunction(LogicalType elementType)
public DataType[] getInputDataTypes()
getInputDataTypes
in class InternalAggregateFunction<MapData,CollectAggFunction.CollectAccumulator<T>>
public DataType getAccumulatorDataType()
getAccumulatorDataType
in class InternalAggregateFunction<MapData,CollectAggFunction.CollectAccumulator<T>>
public DataType getOutputDataType()
getOutputDataType
in class InternalAggregateFunction<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–2021 The Apache Software Foundation. All rights reserved.