Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-21739

TopN with TUMBLE window get Incorrect result

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 1.11.1
    • None
    • Table SQL / Runtime
    • None

    Description

      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;
      

      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.

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            wxmimperio wxmimperio
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: