Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-14785

Support correlated scalar subquery

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.0.0
    • None
    • None

    Description

      For example:

      SELECT a from t where b > (select avg(c) from t2 where t.id = t2.id)
      

      it could be rewritten as

      SELECT a FROM t JOIN (SELECT id, AVG(c) as avg_c FROM t2 GROUP by id) t3 ON t3.id = t.id where b > avg_c
      

      TPCDS Q92, Q81, Q6 required this

      Update: TPCDS Q1 and Q30 also require correlated scalar subquery support.

      Attachments

        Issue Links

          Activity

            People

              hvanhovell Herman van Hövell
              davies Davies Liu
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: