Currently, TableAPI does not have the trigger, due to the behavior of the windows(unbounded, tumble, slide, session) is very clear.The behavior of each window is as follows:
- Unbounded Window - Each set of keys is a grouping, and each event triggers a calculation.
- Tumble Window - A tumbling window assigns rows to non-overlapping, continuous windows of fixed length. Each window outputs one calculation result.
- Slide Window - A sliding window has a fixed size and slides by a specified slide interval. If the slide interval is smaller than the window size, sliding windows are overlapping. Each window outputs one calculation result.
- Session Window - Session windows do not have a fixed size but their bounds are defined by an interval of inactivity, i.e., a session window is closes if no event appears for a defined gap period. Each window outputs one calculation result.
All of those windows are not hold all the input data, the calculations are incremental.
About your case, I think you can use `Unbounded Window` and group by a UDF(time) which return the day unit. e.g.:
table.groupBy(dateFormat('time, "%Y%d")).select('a.sum)
or
table
.select('a, dateFormat('time, "%Y%d").cast(Types.STRING) as 'ts)
.groupBy('ts)
.select('ts, 'a.sum)
Hope to help you!
Best,
Jincheng