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

Daniel Bos commented on HIVE-3577:
----------------------------------

We use 2, 3 and 4 often, migrating to Hive cost us a lot of time since we have 
to rewrite the queries completely. Is there an outlook in which version these 
query options will be added?

> Subquery Unnesting
> ------------------
>
>                 Key: HIVE-3577
>                 URL: https://issues.apache.org/jira/browse/HIVE-3577
>             Project: Hive
>          Issue Type: Sub-task
>    Affects Versions: 0.10.0
>            Reporter: Shane Huang
>
> Hive requires subquery to be used only in the FROM clause. But real-world 
> queries can be much more complex and subqueries could appear in WHERE, having 
> and SELECT clauses. Many of such subqueries can be transformed/unnested to 
> various join operations. This is an umbrella id to include all subquery 
> unnesting work, specifically:
> 1. subquery in WHERE conditions, including subquery used as operand of IN, 
> EXISTS, ISNULL ALL/ANY/SOME, and etc.
> 2. correlated subquery (a correlated subquery is a subquery that refers to a 
> column of a table not in its FROM clause),e.g.
> {code}
> select * from t1 where exists ( select * from t2 where t1.b = t2.y );
> {code}
> 3. scalar subquery (a subquery that returns exactly one column value from one 
> row). e.g. 
> {code}
> select a,b,c,d,e,(select z from t2 where t2.y = t1.b and z != 99 ) from t1;
> {code}
> 4. top-level subquery, e.g.
> {code}
> (select * from t1) union all (select * from t2) union (all select * from t3 
> order by 1);
> {code}
>   



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to