@Internal public final class ArrayAggFunction<T> extends BuiltInAggregateFunction<ArrayData,ArrayAggFunction.ArrayAggAccumulator<T>>
Modifier and Type | Class and Description |
---|---|
static class |
ArrayAggFunction.ArrayAggAccumulator<T>
Accumulator for ARRAY_AGG with retraction.
|
Constructor and Description |
---|
ArrayAggFunction(LogicalType elementType,
boolean ignoreNulls) |
Modifier and Type | Method and Description |
---|---|
void |
accumulate(ArrayAggFunction.ArrayAggAccumulator<T> acc,
T value) |
ArrayAggFunction.ArrayAggAccumulator<T> |
createAccumulator()
Creates and initializes the accumulator for this
ImperativeAggregateFunction . |
DataType |
getAccumulatorDataType() |
List<DataType> |
getArgumentDataTypes() |
DataType |
getOutputDataType() |
ArrayData |
getValue(ArrayAggFunction.ArrayAggAccumulator<T> acc)
Called every time when an aggregation result should be materialized.
|
void |
merge(ArrayAggFunction.ArrayAggAccumulator<T> acc,
Iterable<ArrayAggFunction.ArrayAggAccumulator<T>> its) |
void |
resetAccumulator(ArrayAggFunction.ArrayAggAccumulator<T> acc) |
void |
retract(ArrayAggFunction.ArrayAggAccumulator<T> acc,
T value) |
getRequirements, getTypeInference, isDeterministic
getKind
getAccumulatorType, getResultType
close, functionIdentifier, open, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
supportsConstantFolding
public ArrayAggFunction(LogicalType elementType, boolean ignoreNulls)
public List<DataType> getArgumentDataTypes()
getArgumentDataTypes
in class BuiltInAggregateFunction<ArrayData,ArrayAggFunction.ArrayAggAccumulator<T>>
public DataType getAccumulatorDataType()
getAccumulatorDataType
in class BuiltInAggregateFunction<ArrayData,ArrayAggFunction.ArrayAggAccumulator<T>>
public DataType getOutputDataType()
getOutputDataType
in class BuiltInAggregateFunction<ArrayData,ArrayAggFunction.ArrayAggAccumulator<T>>
public ArrayAggFunction.ArrayAggAccumulator<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<ArrayData,ArrayAggFunction.ArrayAggAccumulator<T>>
public void accumulate(ArrayAggFunction.ArrayAggAccumulator<T> acc, T value) throws Exception
Exception
public void retract(ArrayAggFunction.ArrayAggAccumulator<T> acc, T value) throws Exception
Exception
public void merge(ArrayAggFunction.ArrayAggAccumulator<T> acc, Iterable<ArrayAggFunction.ArrayAggAccumulator<T>> its) throws Exception
Exception
public ArrayData getValue(ArrayAggFunction.ArrayAggAccumulator<T> acc)
AggregateFunction
getValue
in class AggregateFunction<ArrayData,ArrayAggFunction.ArrayAggAccumulator<T>>
acc
- the accumulator which contains the current intermediate resultspublic void resetAccumulator(ArrayAggFunction.ArrayAggAccumulator<T> acc)
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.