Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-18455 General support for correlated subquery processing
  3. SPARK-18603

Support `OuterReference` in projection list of IN correlated subqueries

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Incomplete
    • 2.0.2
    • None
    • SQL

    Description

      This issue aims to allow OuterReference columns in projection lists of IN correlated subqueries.

      SIMPLE EXAMPLE

      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
      

      COMPLEX EXAMPLE

      SELECT *
      FROM t1
      WHERE a IN (SELECT x
                  FROM (SELECT b, a + 1 as x, a + b as y
                        FROM t2)
                  WHERE y > 0)
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            dongjoon Dongjoon Hyun
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: