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

Jark Wu commented on FLINK-20361:
---------------------------------

The result is as expected. You can see the sliding window definition here: 
https://ci.apache.org/projects/flink/flink-docs-master/dev/stream/operators/windows.html#sliding-windows

Do you mean the result of SQL is different than Table API?

> Using sliding window with duration of hours in Table API returns wrong time
> ---------------------------------------------------------------------------
>
>                 Key: FLINK-20361
>                 URL: https://issues.apache.org/jira/browse/FLINK-20361
>             Project: Flink
>          Issue Type: Bug
>          Components: Table SQL / API
>    Affects Versions: 1.11.0, 1.11.1, 1.11.2
>         Environment: Java 11, test executed in IntelliJ IDE on mac OS.
>            Reporter: Aleksandra Cz
>            Priority: Blocker
>             Fix For: 1.11.2
>
>
> If in [Table walkthrough| 
> [https://github.com/apache/flink-playgrounds/blob/master/table-walkthrough/src/main/java/org/apache/flink/playgrounds/spendreport/SpendReport.java]]
>  
> implemented *report* method would be as follows:
>  
> {code:java}
> public static Table report(Table transactions) {
>     return transactions
>             
> .window(Slide.over(lit(1).hours()).every(lit(5).minute()).on($("transaction_time")).as("log_ts"))
>             .groupBy($("log_ts"),$("account_id"))
>             .select(
>                     $("log_ts").start().as("log_ts_start"),
>                     $("log_ts").end().as("log_ts_end"),
>                     $("account_id"),
>                     $("amount").sum().as("amount"));
> {code}
>  
> Then the resulting sliding window start and sliding window end would be in 
> year 1969/1970. Please see first 3 elements of resulting table: 
> {code:java}
> [1969-12-31T23:05,1970-01-01T00:05,3,432, 
> 1969-12-31T23:10,1970-01-01T00:10,3,432, 
> 1969-12-31T23:15,1970-01-01T00:15,3,432]{code}
> This behaviour repeats if using SQL instead of Table API,
> it does not repeat for window duration of minutes, nor in Tumbling window.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to