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/11 11:23:00 UTC
[jira] [Resolved] (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 resolved HIVE-21413.
-----------------------------
Resolution: Won't Fix
Alternative way to solve the issue.
> 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)