Hi Lec,

StateTtlConfig in DataStream API is a configuration on specific state, not
a job level configuration.
TableConfig#setIdleStateRetentionTime in TableAPI&SQL is a job level
configuration which will enable state ttl for all non-time-based operator
states.
In blink planner, the underlying of TableConfig#setIdleStateRetentionTime
uses the StateTtlConfig.
Time-based operators are window aggregation, time-windowed join, and so on.

StateTtlConfig is a state TTL mechanism only works on processing time, not
event-time.
In TableAPI&SQL and DataStream, the window aggregation and time-windowed
join will clear expired state using Timers which is triggered by watermark.
So time-based operators don't use StateTtlConfig to clear expired state.

Best,
Jark


On Tue, 28 Apr 2020 at 14:48, lec ssmi <shicheng31...@gmail.com> wrote:

> Hi:
>   When the stream is joined with another stream , the cached stream data
> will be saved as a state and deleted as the watermark advances.
>   I found that there is also a parameter that can set the state expiration
> time, such as StateTtlConfig in DataStream APIļ¼Œ TableConfig in TableAPI &SQL
>  .This setting is effective for the state of group by operator. And now
> the state TTL seems to be based on processing time.If the configured TTL
> has been reached and the watermark has not moved to the edge. The state of
> join will be cleared ? What is the relationship between StateTtlConfig  and
> TableConfig? If I use  StateTtlConfig  and program with TableAPI, can the
> configuration take effect?
>
>   Best regards
>   Lec Ssmi
>
>

Reply via email to