T- input value
public final class LastDatedValueFunction<T> extends AggregateFunction<Row,LastDatedValueFunction.Accumulator<T>>
AggregateFunctionthat returns a row containing the latest non-null value with its corresponding date.
The function uses a custom
TypeInference and thus disables any of the default
reflection-based logic. It has a generic parameter
T which will result in
(due to type erasure) during runtime. The
TypeInference will provide the necessary
information how to call
accumulate(...) for the given call in the query.
For code readability, we might use some internal utility methods that should rarely change. Implementers can copy those if they don't want to rely on non-official API.
|Modifier and Type||Class and Description|
Generic accumulator for representing state.
|Constructor and Description|
|Modifier and Type||Method and Description|
Generic runtime function that will be called with different kind of instances for
Creates and initializes the accumulator for this
Called every time when an aggregation result should be materialized.
close, functionIdentifier, open, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public TypeInference getTypeInference(DataTypeFactory typeFactory)
TypeInferenceof this function. It specifies:
DataType.getConversionClass()should be used when calling the JVM method
accumulate(Accumulator, Object, LocalDate)during runtime,
public LastDatedValueFunction.Accumulator<T> createAccumulator()
The accumulator is an intermediate data structure that stores the aggregated values until a final aggregation result is computed.
public void accumulate(LastDatedValueFunction.Accumulator<T> acc, T input, java.time.LocalDate date)
inputdepending on actual call in the query.
public Row getValue(LastDatedValueFunction.Accumulator<T> acc)
Copyright © 2014–2023 The Apache Software Foundation. All rights reserved.