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

group by and union all always generate empty query result

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Blocker
    • Resolution: Unresolved
    • 2.3.2
    • None
    • Query Processor
    • None
    • 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

              Unassigned Unassigned
              tiana528 Wang Yan
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated: