[ 
https://issues.apache.org/jira/browse/FLINK-23747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17407505#comment-17407505
 ] 

liwei li commented on FLINK-23747:
----------------------------------

I checked the test code submission records related to Window TVF offset, and 
found that there are already some codes for testing related content, so this 
time, what additional tests do I need to add? I'm a little confused, can you 
give me some guidance [~qingru zhang] ? thanks.

 

[https://github.com/apache/flink/blob/e45c72d1bc6f8c81ba8bb3659fd1cd58e56652d9/flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/runtime/stream/sql/WindowAggregateITCase.scala#L212]

[https://github.com/apache/flink/blob/e45c72d1bc6f8c81ba8bb3659fd1cd58e56652d9/flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/runtime/stream/sql/WindowAggregateITCase.scala#L274]

 

[https://github.com/apache/flink/blob/e45c72d1bc6f8c81ba8bb3659fd1cd58e56652d9/flink-table/flink-table-planner/src/test/scala/org/apache/flink/table/planner/runtime/stream/sql/WindowRankITCase.scala#L243]

 

 

> 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)

Reply via email to