public class LastValueAggFunction<T> extends AggregateFunction<T,GenericRowData>
Modifier and Type | Class and Description |
---|---|
static class |
LastValueAggFunction.BooleanLastValueAggFunction
Built-in Boolean LastValue aggregate function.
|
static class |
LastValueAggFunction.ByteLastValueAggFunction
Built-in Byte LastValue aggregate function.
|
static class |
LastValueAggFunction.DecimalLastValueAggFunction
Built-in DecimalData LastValue aggregate function.
|
static class |
LastValueAggFunction.DoubleLastValueAggFunction
Built-in Double LastValue aggregate function.
|
static class |
LastValueAggFunction.FloatLastValueAggFunction
Built-in Float LastValue aggregate function.
|
static class |
LastValueAggFunction.IntLastValueAggFunction
Built-in Int LastValue aggregate function.
|
static class |
LastValueAggFunction.LongLastValueAggFunction
Built-in Long LastValue aggregate function.
|
static class |
LastValueAggFunction.ShortLastValueAggFunction
Built-in Short LastValue aggregate function.
|
static class |
LastValueAggFunction.StringLastValueAggFunction
Built-in String LastValue aggregate function.
|
Constructor and Description |
---|
LastValueAggFunction() |
Modifier and Type | Method and Description |
---|---|
void |
accumulate(GenericRowData acc,
Object value) |
void |
accumulate(GenericRowData acc,
Object value,
Long order) |
GenericRowData |
createAccumulator()
Creates and initializes the accumulator for this
UserDefinedAggregateFunction . |
TypeInformation<GenericRowData> |
getAccumulatorType()
Returns the
TypeInformation of the UserDefinedAggregateFunction 's
accumulator. |
T |
getValue(GenericRowData 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(GenericRowData acc) |
getKind, getRequirements, getTypeInference, requiresOver
getResultType
close, functionIdentifier, open, toString
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 pure functional like random(), date(), now(), ...
this method must return false
.
public GenericRowData createAccumulator()
UserDefinedAggregateFunction
UserDefinedAggregateFunction
. The
accumulator is used to keep the aggregated values which are needed to compute an aggregation
result.createAccumulator
in class UserDefinedAggregateFunction<T,GenericRowData>
public void accumulate(GenericRowData acc, Object value)
public void accumulate(GenericRowData acc, Object value, Long order)
public void resetAccumulator(GenericRowData acc)
public T getValue(GenericRowData acc)
AggregateFunction
getValue
in class AggregateFunction<T,GenericRowData>
acc
- the accumulator which contains the current aggregated resultspublic TypeInformation<GenericRowData> getAccumulatorType()
UserDefinedAggregateFunction
TypeInformation
of the UserDefinedAggregateFunction
's
accumulator.getAccumulatorType
in class UserDefinedAggregateFunction<T,GenericRowData>
TypeInformation
of the UserDefinedAggregateFunction
's accumulator
or null
if the accumulator type should be automatically inferred.Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.