public class LagAggFunction<T> extends BuiltInAggregateFunction<T,LagAggFunction.LagAcc<T>>
AggregateFunction
.Modifier and Type | Class and Description |
---|---|
static class |
LagAggFunction.LagAcc<T>
Accumulator for LAG.
|
Constructor and Description |
---|
LagAggFunction(LogicalType[] valueTypes) |
Modifier and Type | Method and Description |
---|---|
void |
accumulate(LagAggFunction.LagAcc<T> acc,
T value) |
void |
accumulate(LagAggFunction.LagAcc<T> acc,
T value,
int offset) |
void |
accumulate(LagAggFunction.LagAcc<T> acc,
T value,
int offset,
T defaultValue) |
LagAggFunction.LagAcc<T> |
createAccumulator()
Creates and initializes the accumulator for this
ImperativeAggregateFunction . |
DataType |
getAccumulatorDataType() |
List<DataType> |
getArgumentDataTypes() |
DataType |
getOutputDataType() |
T |
getValue(LagAggFunction.LagAcc<T> acc)
Called every time when an aggregation result should be materialized.
|
void |
resetAccumulator(LagAggFunction.LagAcc<T> acc) |
getRequirements, getTypeInference, isDeterministic
getKind
getAccumulatorType, getResultType
close, functionIdentifier, open, toString
public LagAggFunction(LogicalType[] valueTypes)
public List<DataType> getArgumentDataTypes()
getArgumentDataTypes
in class BuiltInAggregateFunction<T,LagAggFunction.LagAcc<T>>
public DataType getAccumulatorDataType()
getAccumulatorDataType
in class BuiltInAggregateFunction<T,LagAggFunction.LagAcc<T>>
public DataType getOutputDataType()
getOutputDataType
in class BuiltInAggregateFunction<T,LagAggFunction.LagAcc<T>>
public void accumulate(LagAggFunction.LagAcc<T> acc, T value) throws Exception
Exception
public void accumulate(LagAggFunction.LagAcc<T> acc, T value, int offset) throws Exception
Exception
public void accumulate(LagAggFunction.LagAcc<T> acc, T value, int offset, T defaultValue) throws Exception
Exception
public void resetAccumulator(LagAggFunction.LagAcc<T> acc) throws Exception
Exception
public T getValue(LagAggFunction.LagAcc<T> acc)
AggregateFunction
getValue
in class AggregateFunction<T,LagAggFunction.LagAcc<T>>
acc
- the accumulator which contains the current intermediate resultspublic LagAggFunction.LagAcc<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<T,LagAggFunction.LagAcc<T>>
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.