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

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

    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

          People

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

            Dates

              Created:
              Updated:
              Resolved: