[ https://issues.apache.org/jira/browse/FLINK-23747?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Xintong Song closed FLINK-23747. -------------------------------- Resolution: Done > Testing Window TVF offset > ------------------------- > > Key: FLINK-23747 > URL: https://issues.apache.org/jira/browse/FLINK-23747 > Project: Flink > Issue Type: Improvement > Components: Tests > Reporter: JING ZHANG > Assignee: liwei li > Priority: Blocker > Labels: release-testing > Fix For: 1.14.0 > > > Window offset is an optional parameter which could be used to change the > alignment of windows. > There are something we need clarify about window offset: > (1) In SQL, window offset is an optional parameter, if it is specified, it is > the last parameter of the window. > for Tumble window > {code:java} > TUMBLE(TABLE MyTable, DESCRIPTOR(rowtime), INTERVAL '15' MINUTE, INTERVAL '5' > MINUTE){code} > for Hop Window > {code:java} > HOP(TABLE MyTable, DESCRIPTOR(rowtime), INTERVAL '1' MINUTE, INTERVAL '15' > MINUTE, > INTERVAL '5' MINUTE){code} > for Cumulate Window > {code:java} > CUMULATE(TABLE MyTable, DESCRIPTOR(rowtime), INTERVAL '1' MINUTE, INTERVAL > '15' MINUTE, INTERVAL '5' MINUTE){code} > (2) Window offset could be positive duration and negative duration. > (3) Window offset is used to change the alignment of Windows. The same record > may be assigned to the different window after set window offset. But it > always apply a rule, timestamp >= window_start && timestamp < window_end. > Give a demo, for a tumble window, window size is 10 MINUTE, which window > would be assigned to for a record with timestamp 2021-06-30 00:00:04? > # offset is '-16 MINUTE', the record assigns to window [2021-06-29 > 23:54:00, 2021-06-30 00:04:00) > # offset is '-6 MINUTE', the record assigns to window [2021-06-29 23:54:00, > 2021-06-30 00:04:00) > # offset is '-4 MINUTE', the record assigns to window [2021-06-29 23:56:00, > 2021-06-30 00:06:00) > # offset is '0', the record assigns to window [2021-06-30 00:00:00, > 2021-06-30 00:10:00) > # offset is '4 MINUTE', the record assigns to window [2021-06-29 23:54:00, > 2021-06-30 00:04:00) > # offset is '6 MINUTE, the record assigns to window [2021-06-29 23:56:00, > 2021-06-30 00:06:00) > # offset is '16 MINUTE', the record assigns to window [2021-06-29 23:56:00, > 2021-06-30 00:06:00) > (4) We could find that, some window offset parameters may have same effect on > the alignment of windows, in the above case, '-16 MINUTE' /'-6 MINUTE'/'4 > MINUTE' have same effect on a tumble window with '10 MINUTE' size. > (5) Window offset is only used to change the alignment of Windows, it has no > effect on watermark. -- This message was sent by Atlassian Jira (v8.3.4#803005)