Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-13072

ROW_NUMBER() function creates wrong results

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 1.1.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      When using ROW_NUMBER() on tables with more than 25000 rows, the function ROW_NUMBER() duplicates rows with separate row numbers.

      Reproduce by using a large table with more than 25000 rows with distinct values and then using a query involving ROW_NUMBER(). It will then result in getting the same distinct values twice with separate row numbers apart by 25000.

        Issue Links

          Activity

          Hide
          ychena Yongzhi Chen added a comment -

          I can not reproduce the issue in the master branch with query:
          insert overwrite table rowninfo select row_number() over( order by num) as rowid, num from disrow;
          disrow has 329210 rows with distinct values.
          After the insert statement, rowninfo has same number of rows with distinct row values. There is no duplicate.
          Philipp Brandl, could you share your reproduce? Thanks

          Show
          ychena Yongzhi Chen added a comment - I can not reproduce the issue in the master branch with query: insert overwrite table rowninfo select row_number() over( order by num) as rowid, num from disrow; disrow has 329210 rows with distinct values. After the insert statement, rowninfo has same number of rows with distinct row values. There is no duplicate. Philipp Brandl , could you share your reproduce? Thanks
          Hide
          ashutoshc Ashutosh Chauhan added a comment -

          Yongzhi Chen Did you try with version 1.1 Reporter has indicated that in Affect Version.
          Philipp Brandl Can you provide repro query for this? Also, if possible can you try this on master ?

          Show
          ashutoshc Ashutosh Chauhan added a comment - Yongzhi Chen Did you try with version 1.1 Reporter has indicated that in Affect Version. Philipp Brandl Can you provide repro query for this? Also, if possible can you try this on master ?
          Hide
          ychena Yongzhi Chen added a comment -

          I tried hive version 1.1 for CDH, still can not reproduce the issue.

          Show
          ychena Yongzhi Chen added a comment - I tried hive version 1.1 for CDH, still can not reproduce the issue.
          Hide
          ashutoshc Ashutosh Chauhan added a comment -

          HIVE-11583 may have fixed this too.

          Show
          ashutoshc Ashutosh Chauhan added a comment - HIVE-11583 may have fixed this too.

            People

            • Assignee:
              ychena Yongzhi Chen
              Reporter:
              Zyrix Philipp Brandl
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development