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

Count() function over partitions doesn't work properly with ORDER BY

Log workAgile BoardRank to TopRank to BottomBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Not A Problem
    • 2.1.0
    • None
    • PTF-Windowing
    • None

    Description

      The following query doesn't seem to return the correct result.

      create table test (empno string, deptno string, level string, manager string);
      insert into test values ('1', '2', 'B', 'Else'); 
      insert into test values ('1', '2', 'B', 'Else');
      insert into test values ('2', '2', 'B', 'Other');
      
      select  count( manager) over (partition by deptno, level order by manager) from test; 
      

      It returns

      2
      2
      3
      

      Without ORDER BY, it returns correct result

      3
      3
      3
      

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            Unassigned Unassigned Assign to me
            aihuaxu Aihua Xu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment