[jira] [Created] (FLINK-20361) Using sliding window with duration of hours in Table API returns wrong time

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (FLINK-20361) Using sliding window with duration of hours in Table API returns wrong time

Shang Yuanchun (Jira)
Aleksandra Cz created FLINK-20361:
-------------------------------------

             Summary: 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.2, 1.11.1, 1.11.0
         Environment: Java 11, test executed in IntelliJ IDE on mac OS.
            Reporter: Aleksandra Cz
             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)