Stateful computing involves storing and retrieving state while evaluating expressions in an Expression transformation.
You can use variable port definitions in Expression transformations to perform stateful computing in a streaming mapping.
Use variable port definitions to perform the following tasks:
Calculate and store the state in stateful variables when an event arrives.
Use the stored state and input to compute the output.
When you configure the Expression transformation, configure the partition keys on the
Windowing
tab. When you define variable ports in an Expression transformation, you can optionally specify a partition key that uses one or more input ports. The partition keys determine which columns to group the data by while performing stateful computing. The stored state will have one value for every stateful variable for each value of the partition key.
The evaluation of the ports is ordered. The output ports are computed after the variable ports are computed and contain updated values of variables.
When you configure windowing properties, you define a stateful expression in the Expression transformation. Streaming mappings support all the expression transform function except Window functions and aggregate functions.
For more information about guidelines for configuring variable ports, see the