public abstract class FirstValueAggFunction<T> extends AggregateFunction<T,GenericRowData>
Modifier and Type | Class and Description |
---|---|
static class |
FirstValueAggFunction.BooleanFirstValueAggFunction
Built-in Boolean FirstValue aggregate function.
|
static class |
FirstValueAggFunction.ByteFirstValueAggFunction
Built-in Byte FirstValue aggregate function.
|
static class |
FirstValueAggFunction.DecimalFirstValueAggFunction
Built-in DecimalData FirstValue aggregate function.
|
static class |
FirstValueAggFunction.DoubleFirstValueAggFunction
Built-in Double FirstValue aggregate function.
|
static class |
FirstValueAggFunction.FloatFirstValueAggFunction
Built-in Float FirstValue aggregate function.
|
static class |
FirstValueAggFunction.IntFirstValueAggFunction
Built-in Int FirstValue aggregate function.
|
static class |
FirstValueAggFunction.LongFirstValueAggFunction
Built-in Long FirstValue aggregate function.
|
static class |
FirstValueAggFunction.ShortFirstValueAggFunction
Built-in Short FirstValue aggregate function.
|
static class |
FirstValueAggFunction.StringFirstValueAggFunction
Built-in String FirstValue aggregate function.
|
Constructor and Description |
---|
FirstValueAggFunction() |
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.