[
https://issues.apache.org/jira/browse/FLINK-21739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17300100#comment-17300100
]
Jark Wu edited comment on FLINK-21739 at 3/12/21, 7:19 AM:
-----------------------------------------------------------
Currently, the output of this query is an updating stream. That's why you will
see more than 5 records (actually is changelogs) for every window_start. If you
have an upsert sink with the same primary key (i.e. window_start + rownum),
e.g. mysql, there should only be 5 records for each window_start.
was (Author: jark):
Currently, the output of this query is an updating stream. That's why you will
see more than 5 records for every window_start. If you have an upsert sink with
the same primary key (i.e. window_start + rownum), e.g. mysql, there should
only be 5 records for each window_start.
> 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
> Priority: Major
>
> {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)