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

Xuefu Zhang commented on HIVE-5690:
-----------------------------------

Sorry for chiming in late, but I'm not sure if I understand the use case 
correctly. Wouldn't the above query can be rewritten as
{code}
explain from (select distinct key, value ) X
insert overwrite table x1 select *  order by key
insert overwrite table x2 select *  order by value;
{code}

Since the multi-insert is to insert from a single source specified by the 
from-clause, allowing subquery in later select clause seems defeating that 
purpose.


> Support subquery for single sourced multi query
> -----------------------------------------------
>
>                 Key: HIVE-5690
>                 URL: https://issues.apache.org/jira/browse/HIVE-5690
>             Project: Hive
>          Issue Type: Improvement
>          Components: Query Processor
>            Reporter: Navis
>            Assignee: Navis
>            Priority: Minor
>         Attachments: D13791.1.patch, HIVE-5690.10.patch.txt, 
> HIVE-5690.11.patch.txt, HIVE-5690.12.patch.txt, HIVE-5690.2.patch.txt, 
> HIVE-5690.3.patch.txt, HIVE-5690.4.patch.txt, HIVE-5690.5.patch.txt, 
> HIVE-5690.6.patch.txt, HIVE-5690.7.patch.txt, HIVE-5690.8.patch.txt, 
> HIVE-5690.9.patch.txt
>
>
> Single sourced multi (insert) query is very useful for various ETL processes 
> but it does not allow subqueries included. For example, 
> {noformat}
> explain from src 
> insert overwrite table x1 select * from (select distinct key,value) b order 
> by key
> insert overwrite table x2 select * from (select distinct key,value) c order 
> by value;
> {noformat}



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

Reply via email to