@Internal public final class FirstValueAggFunction<T> extends BuiltInAggregateFunction<T,RowData>
Constructor and Description |
---|
FirstValueAggFunction(LogicalType valueType) |
Modifier and Type | Method and Description |
---|---|
void |
accumulate(RowData rowData,
Object value) |
void |
accumulate(RowData rowData,
Object value,
Long order) |
void |
accumulate(RowData rowData,
StringData value) |
void |
accumulate(RowData rowData,
StringData value,
Long order) |
RowData |
createAccumulator()
Creates and initializes the accumulator for this
ImperativeAggregateFunction . |
DataType |
getAccumulatorDataType() |
List<DataType> |
getArgumentDataTypes() |
DataType |
getOutputDataType() |
T |
getValue(RowData acc)
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
public FirstValueAggFunction(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(RowData rowData, StringData value)
public void accumulate(RowData rowData, StringData value, Long order)
public void resetAccumulator(RowData rowData)
public T getValue(RowData acc)
AggregateFunction
getValue
in class AggregateFunction<T,RowData>
acc
- the accumulator which contains the current intermediate resultsCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.