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

group by and union all always generate empty query result

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Blocker
    • Resolution: Unresolved
    • Affects Version/s: 2.3.2
    • Fix Version/s: None
    • Component/s: Query Processor
    • Labels:
      None
    • Environment:

      Run on MR, hadoop 2.7.3

      Description

      The following query always generates empty results which is wrong.

      create table if not exists test_table(column1 string, column2 int);
      insert into test_table values('a',1),('b',2);
      set hive.optimize.union.remove=true;
      
      select column1 from test_table group by column1
      union all
      select column1 from test_table group by column1;
      
      

      Actual result : empty

      Expected result: 

      a
      
      b
      
      a
      
      b
      
      

      Note that correct result is generated when set hive.optimize.union.remove=false.

      It seems like the fix in HIVE-12788 is insufficient.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                tiana528 Wang Yan
              • Votes:
                1 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated: