T
- input valuepublic final class LastDatedValueFunction<T> extends org.apache.flink.table.functions.AggregateFunction<org.apache.flink.types.Row,LastDatedValueFunction.Accumulator<T>>
AggregateFunction
that 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 Object
(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.
限定符和类型 | 类和说明 |
---|---|
static class |
LastDatedValueFunction.Accumulator<T>
Generic accumulator for representing state.
|
构造器和说明 |
---|
LastDatedValueFunction() |
限定符和类型 | 方法和说明 |
---|---|
void |
accumulate(LastDatedValueFunction.Accumulator<T> acc,
T input,
java.time.LocalDate date)
Generic runtime function that will be called with different kind of instances for
input depending on actual call in the query. |
LastDatedValueFunction.Accumulator<T> |
createAccumulator() |
org.apache.flink.table.types.inference.TypeInference |
getTypeInference(org.apache.flink.table.catalog.DataTypeFactory typeFactory)
Declares the
TypeInference of this function. |
org.apache.flink.types.Row |
getValue(LastDatedValueFunction.Accumulator<T> acc) |
getAccumulatorType, getResultType
close, functionIdentifier, open, toString
public org.apache.flink.table.types.inference.TypeInference getTypeInference(org.apache.flink.table.catalog.DataTypeFactory typeFactory)
TypeInference
of this function. It specifies:
DataType.getConversionClass()
should be used when calling the JVM method
accumulate(Accumulator, Object, LocalDate)
during runtime,
getTypeInference
在接口中 org.apache.flink.table.functions.FunctionDefinition
getTypeInference
在类中 org.apache.flink.table.functions.AggregateFunction<org.apache.flink.types.Row,LastDatedValueFunction.Accumulator<T>>
public LastDatedValueFunction.Accumulator<T> createAccumulator()
createAccumulator
在类中 org.apache.flink.table.functions.ImperativeAggregateFunction<org.apache.flink.types.Row,LastDatedValueFunction.Accumulator<T>>
public void accumulate(LastDatedValueFunction.Accumulator<T> acc, T input, java.time.LocalDate date)
input
depending on actual call in the query.public org.apache.flink.types.Row getValue(LastDatedValueFunction.Accumulator<T> acc)
getValue
在类中 org.apache.flink.table.functions.AggregateFunction<org.apache.flink.types.Row,LastDatedValueFunction.Accumulator<T>>
Copyright © 2014–2022 The Apache Software Foundation. All rights reserved.