You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Vineet Garg (JIRA)" <ji...@apache.org> on 2018/06/11 22:38:01 UTC

[jira] [Assigned] (HIVE-19863) UNION query produce wrong results

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

Vineet Garg reassigned HIVE-19863:
----------------------------------


> UNION query produce wrong results
> ---------------------------------
>
>                 Key: HIVE-19863
>                 URL: https://issues.apache.org/jira/browse/HIVE-19863
>             Project: Hive
>          Issue Type: Bug
>          Components: Query Planning
>            Reporter: Vineet Garg
>            Assignee: Vineet Garg
>            Priority: Major
>
> *Reproducer*
> {code:sql}
> SET hive.vectorized.execution.enabled=false;
> set hive.map.aggr=false;
> set hive.strict.checks.bucketing=false;
> set hive.explain.user=true;
> CREATE TABLE src1 (key STRING COMMENT 'default', value STRING COMMENT 'default') STORED AS TEXTFILE;
> LOAD DATA LOCAL INPATH "${hiveconf:test.data.dir}/kv3.txt" INTO TABLE src1;
> ANALYZE TABLE src1 COMPUTE STATISTICS;
> ANALYZE TABLE src1 COMPUTE STATISTICS FOR COLUMNS key,value;
> CREATE TABLE src (key STRING COMMENT 'default', value STRING COMMENT 'default') STORED AS TEXTFILE;
> LOAD DATA LOCAL INPATH "${hiveconf:test.data.dir}/kv1.txt" INTO TABLE src;
> ANALYZE TABLE src COMPUTE STATISTICS;
> ANALYZE TABLE src COMPUTE STATISTICS FOR COLUMNS key,value;
> SELECT x.key, z.value, y.value
> FROM src1 x JOIN src y ON (x.key = y.key) 
> JOIN (select * from src1 union select * from src)z ON (x.value = z.value)
> union
> SELECT x.key, z.value, y.value
> FROM src1 x JOIN src y ON (x.key = y.key) 
> JOIN (select * from src1 union select * from src)z ON (x.value = z.value);
> {code}
> *Expected Result*
> {code:sql}
> 128		val_128
> 146	val_146	val_146
> 150	val_150	val_150
> 213	val_213	val_213
> 224		val_224
> 238	val_238	val_238
> 255	val_255	val_255
> 273	val_273	val_273
> 278	val_278	val_278
> 311	val_311	val_311
> 369		val_369
> 401	val_401	val_401
> 406	val_406	val_406
> 66	val_66	val_66
> 98	val_98	val_98
> {code}
> *Actual Result*
> {code:sql}
> 128
> 146	val_146
> 150	val_150
> 213	val_213
> 224
> 238	val_238
> 255	val_255
> 273	val_273
> 278	val_278
> 311	val_311
> 369
> 401	val_401
> 406	val_406
> 66	val_66
> 98	val_98
> {code}
> One whole column is missing from the result



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