Annotation Type StateHint
State hints are primarily intended for ProcessTableFunction. A PTF supports multiple
state entries at the beginning of an eval()/onTimer() method (after an optional context
parameter).
Aggregating functions (i.e. AggregateFunction and TableAggregateFunction)
support a single state entry at the beginning of an accumulate()/retract() method (i.e. the
accumulator).
For example, @StateHint(name = "count", type = @DataTypeHint("BIGINT")) is a state
entry with the data type BIGINT named "count".
Note: Usually, a state entry is partitioned by a key and can not be accessed globally. The partitioning (or whether it is only a single partition) is defined by the corresponding function call.
- See Also:
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionThe name of the state entry.The data type hint for the state entry.
-
Element Details
-
name
String nameThe name of the state entry. It must be unique among other state entries.This can be used to provide a descriptive name for the state entry. The name can be used for referencing the entry during clean up.
- Default:
- ""
-
type
DataTypeHint typeThe data type hint for the state entry.This can be used to provide additional information about the expected data type of the argument. The
DataTypeHintannotation can be used to specify the data type explicitly or provide hints for the reflection-based extraction of the data type.- Default:
- @org.apache.flink.table.annotation.DataTypeHint
-