hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wang Yan (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HIVE-20319) group by and union all always generate empty query result
Date Mon, 06 Aug 2018 16:00:00 GMT

     [ https://issues.apache.org/jira/browse/HIVE-20319?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Wang Yan updated HIVE-20319:
----------------------------
    Description: 
The following query always generates empty results which is wrong.
{code:sql}
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;

{code}
Actual result : empty

Expected result: 
{code:java}
a

b

a

b

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

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

  was:
The following query always generates empty results which is wrong.
{code:sql}
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;

{code}
Actual result : empty

Expected result: 
{code:java}
a

b

a

b

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

It seems like the fix in https://issues.apache.org/jira/browse/HIVE-12788 is insufficient.


> group by and union all always generate empty query result
> ---------------------------------------------------------
>
>                 Key: HIVE-20319
>                 URL: https://issues.apache.org/jira/browse/HIVE-20319
>             Project: Hive
>          Issue Type: Bug
>          Components: Query Processor
>    Affects Versions: 2.3.2
>            Reporter: Wang Yan
>            Priority: Blocker
>
> The following query always generates empty results which is wrong.
> {code:sql}
> 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;
> {code}
> Actual result : empty
> Expected result: 
> {code:java}
> a
> b
> a
> b
> {code}
> Note that correct result is generated when set hive.optimize.union.remove=false.
> It seems like the fix in HIVE-12788 is insufficient.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message