[ 
https://issues.apache.org/jira/browse/HIVE-9217?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14259238#comment-14259238
 ] 

Pengcheng Xiong commented on HIVE-9217:
---------------------------------------

[~jpullokkaran] and [~hagleitn], the test failure is not related. Could you 
please take a look? Thanks. The main reason for the bug is that,  when we add 
subq outside union, we will have

UNION-SEL-SEL-FS
                |-SEL-FS

However, the current version only checks if UNION operator has more than 1 
children.

The solution is simply to check every operator after UNION.


> UnionProcessor misses results for multi-insert when 
> hive.optimize.union.remove=true
> -----------------------------------------------------------------------------------
>
>                 Key: HIVE-9217
>                 URL: https://issues.apache.org/jira/browse/HIVE-9217
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Pengcheng Xiong
>            Assignee: Pengcheng Xiong
>         Attachments: HIVE-9217.01.patch
>
>
> To reproduce:
> In union_remove_6.q, just change 
> FROM (
>   SELECT key, count(1) as values from inputTbl1 group by key
>   UNION ALL
>   SELECT key, count(1) as values from inputTbl1 group by key
> ) a
> insert overwrite table outputTbl1 select *
> insert overwrite table outputTbl2 select *;
> to 
> FROM (
>   select * from(
>   SELECT key, count(1) as values from inputTbl1 group by key
>   UNION ALL
>   SELECT key, count(1) as values from inputTbl1 group by key
>   )subq
> ) a
> insert overwrite table outputTbl1 select *
> insert overwrite table outputTbl2 select *;
> select * from outputtbl2 will output nothing



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to