@Internal public final class LastValueAggFunction<T> extends BuiltInAggregateFunction<T,RowData>
Constructor and Description |
---|
LastValueAggFunction(LogicalType valueType) |
Modifier and Type | Method and Description |
---|---|
void |
accumulate(GenericRowData acc,
StringData value) |
void |
accumulate(GenericRowData acc,
StringData value,
Long order) |
void |
accumulate(RowData rowData,
Object value) |
void |
accumulate(RowData rowData,
Object value,
Long order) |
RowData |
createAccumulator()
Creates and initializes the accumulator for this
ImperativeAggregateFunction . |
DataType |
getAccumulatorDataType() |
List<DataType> |
getArgumentDataTypes() |
DataType |
getOutputDataType() |
T |
getValue(RowData rowData)
Called every time when an aggregation result should be materialized.
|
boolean |
isDeterministic()
Returns information about the determinism of the function's results.
|
void |
resetAccumulator(RowData rowData) |
getRequirements, getTypeInference
getKind
getAccumulatorType, getResultType
close, functionIdentifier, open, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
supportsConstantFolding
public LastValueAggFunction(LogicalType valueType)
public List<DataType> getArgumentDataTypes()
getArgumentDataTypes
in class BuiltInAggregateFunction<T,RowData>
public DataType getAccumulatorDataType()
getAccumulatorDataType
in class BuiltInAggregateFunction<T,RowData>
public DataType getOutputDataType()
getOutputDataType
in class BuiltInAggregateFunction<T,RowData>
public boolean isDeterministic()
FunctionDefinition
It returns true
if and only if a call to this function is guaranteed to
always return the same result given the same parameters. true
is assumed by
default. If the function is not purely functional like random(), date(), now(), ...
this method must return false
.
Furthermore, return false
if the planner should always execute this function
on the cluster side. In other words: the planner should not perform constant expression
reduction during planning for constant calls to this function.
isDeterministic
in interface FunctionDefinition
isDeterministic
in class BuiltInAggregateFunction<T,RowData>
public RowData 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,RowData>
public void accumulate(GenericRowData acc, StringData value)
public void accumulate(GenericRowData acc, StringData value, Long order)
public void resetAccumulator(RowData rowData)
public T getValue(RowData rowData)
AggregateFunction
getValue
in class AggregateFunction<T,RowData>
rowData
- the accumulator which contains the current intermediate resultsCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.