[jira] [Created] (FLINK-21739) TopN with TUMBLE window get Incorrect result

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

[jira] [Created] (FLINK-21739) TopN with TUMBLE window get Incorrect result

Shang Yuanchun (Jira)
wxmimperio created FLINK-21739:
----------------------------------

             Summary: TopN with TUMBLE window get Incorrect result
                 Key: FLINK-21739
                 URL: https://issues.apache.org/jira/browse/FLINK-21739
             Project: Flink
          Issue Type: Bug
          Components: Table SQL / Runtime
    Affects Versions: 1.11.1
            Reporter: wxmimperio


{code:java}
SELECT * FROM (
  SELECT * ,
  ROW_NUMBER() OVER (
    PARTITION BY window_start
    ORDER BY gap_transactions desc
  ) AS rownum
  FROM (
    SELECT TUMBLE_START(event_time, INTERVAL '5' MINUTE) AS window_start, itemId, sum(reply_gap) AS gap_transactions
    FROM ItemTransactions
    GROUP BY itemId, TUMBLE(event_time, INTERVAL '5' MINUTE)
  )
)
WHERE rownum <=5;
{code}
I want to get the maximum sum of every 5 minutes window.

The expected result is that there are only 5 records every 5 minutes, But the reality is that there are more than 5 pieces of data every 5 minutes.

 



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