You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Nattavut Sutyanyong (JIRA)" <ji...@apache.org> on 2016/11/28 01:15:58 UTC

[jira] [Commented] (SPARK-18603) Support `OuterReference` in projection list of IN correlated subqueries

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

Nattavut Sutyanyong commented on SPARK-18603:
---------------------------------------------

[~dongjoon] Shall we coordinate this PR with SPARK-18455?

> Support `OuterReference` in projection list of IN correlated subqueries
> -----------------------------------------------------------------------
>
>                 Key: SPARK-18603
>                 URL: https://issues.apache.org/jira/browse/SPARK-18603
>             Project: Spark
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 2.0.2
>            Reporter: Dongjoon Hyun
>
> This issue aims to allow OuterReference columns in projection lists of IN correlated subqueries. 
> *SIMPLE EXAMPLE*
> {code}
> scala> sql("CREATE TEMPORARY VIEW t1 AS SELECT * FROM VALUES 1, 2 AS t1(a)")
> scala> sql("CREATE TEMPORARY VIEW t2 AS SELECT * FROM VALUES 1 AS t2(b)")
> scala> sql("SELECT a FROM t1 WHERE a IN (SELECT a FROM t2)").show
> {code}
> *COMPLEX EXAMPLE*
> {code}
> SELECT *
> FROM t1
> WHERE a IN (SELECT x
>             FROM (SELECT b, a + 1 as x, a + b as y
>                   FROM t2)
>             WHERE y > 0)
> {code}



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

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org