You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Stéphane (JIRA)" <ji...@apache.org> on 2019/03/08 14:19:00 UTC

[jira] [Updated] (HIVE-21413) Bad result using UNION using same table

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

Stéphane updated HIVE-21413:
----------------------------
    Environment: 
engine = mr

TBLPROPERTIES(
     'auto.purge'='true',
     'orc.compress'='ZLIB',
     'serialization.null.format'=''
 )

 

  was:
engine = mr

 

TBLPROPERTIES(
    'auto.purge'='true',
    'orc.compress'='ZLIB',
    'serialization.null.format'=''
)

 

    Description: 
Hi,

I have a table named "sau' with 1000 rows.

The table structure is :
  
||col_name||data_type||comment||
|id|string| |
|mnta|int| |
|mntb|int| |
{quote}select id, 'A' as info, mntA as mnt from sau
 union
 select id, 'B' as info, mntB as mnt from sau
{quote}
==> return only rows with "info=B"
{quote}with
cte_union as (
 select id, 'A' as info, mntA as mnt from sau
 union
 select id, 'B' as info, mntB as mnt from sau
 )
 select
 count(*)
 from
 cte_union
{quote}
==> return 1000 but should be 2000
  
 I don't know if this bug is fixed on new version.

Using "union all" clause, the result is correct.

  was:
Hi,

I have a table named "sau' with 1000 rows.

The table structure is :
 
||col_name ||data_type||comment |
|id       |string    |        |
|mnta     |int       |        |
|mntb     |int       |        |

{quote}with
cte as (
    select * from sau
)
select id, 'A' as info, mntA as mnt from cte
union
select id, 'B' as info, mntB as mnt from cte
{quote}
==> return only rows with "info=B"

{quote}with
cte as (
    select * from sau
),
cte_union as (
    select id, 'A' as info, mntA as mnt from cte
    union
    select id, 'B' as info, mntB as mnt from cte
)
select
    count(*)
from
    cte_union{quote}

==> return 1000 but should be 2000
 
I don't know if this bug is fixed on new version.

Using "union all" clause, the result is correct.



> Bad result using UNION using same table
> ---------------------------------------
>
>                 Key: HIVE-21413
>                 URL: https://issues.apache.org/jira/browse/HIVE-21413
>             Project: Hive
>          Issue Type: Bug
>          Components: hpl/sql
>    Affects Versions: 1.2.1
>         Environment: engine = mr
> TBLPROPERTIES(
>      'auto.purge'='true',
>      'orc.compress'='ZLIB',
>      'serialization.null.format'=''
>  )
>  
>            Reporter: Stéphane
>            Priority: Minor
>
> Hi,
> I have a table named "sau' with 1000 rows.
> The table structure is :
>   
> ||col_name||data_type||comment||
> |id|string| |
> |mnta|int| |
> |mntb|int| |
> {quote}select id, 'A' as info, mntA as mnt from sau
>  union
>  select id, 'B' as info, mntB as mnt from sau
> {quote}
> ==> return only rows with "info=B"
> {quote}with
> cte_union as (
>  select id, 'A' as info, mntA as mnt from sau
>  union
>  select id, 'B' as info, mntB as mnt from sau
>  )
>  select
>  count(*)
>  from
>  cte_union
> {quote}
> ==> return 1000 but should be 2000
>   
>  I don't know if this bug is fixed on new version.
> Using "union all" clause, the result is correct.



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