[ https://issues.apache.org/jira/browse/HIVE-3577?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Daniel Bos updated HIVE-3577: ----------------------------- Labels: features (was: ) > 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, 0.11.0, 0.12.0, 0.13.0 > Reporter: Shane Huang > Priority: Critical > Labels: features > > 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)