public abstract class FirstValueAggFunction<T> extends AggregateFunction<T,GenericRow>
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 Decimal 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(GenericRow acc,
Object value) |
void |
accumulate(GenericRow acc,
Object value,
Long order) |
GenericRow |
createAccumulator()
Creates and initializes the accumulator for this
UserDefinedAggregateFunction . |
TypeInformation<GenericRow> |
getAccumulatorType()
Returns the
TypeInformation of the UserDefinedAggregateFunction 's accumulator. |
T |
getValue(GenericRow 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(GenericRow acc) |
getKind, getRequirements, 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 GenericRow 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,GenericRow>
public void accumulate(GenericRow acc, Object value)
public void accumulate(GenericRow acc, Object value, Long order)
public void resetAccumulator(GenericRow acc)
public T getValue(GenericRow acc)
AggregateFunction
getValue
in class AggregateFunction<T,GenericRow>
acc
- the accumulator which contains the current
aggregated resultspublic TypeInformation<GenericRow> getAccumulatorType()
UserDefinedAggregateFunction
TypeInformation
of the UserDefinedAggregateFunction
's accumulator.getAccumulatorType
in class UserDefinedAggregateFunction<T,GenericRow>
TypeInformation
of the UserDefinedAggregateFunction
's accumulator
or null
if the accumulator type should be automatically inferred.Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.