Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-35553 Improve correlated subqueries
  3. SPARK-36191

Support ORDER BY and LIMIT to be on the correlation path

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.2.0
    • 4.0.0
    • SQL

    Description

      A correlation path is defined as the sub-tree of all the operators that are on the path from the operator hosting the correlated expressions up to the operator producing the correlated values. 

      We want to support ORDER BY (Sort) and LIMT operators to be on the correlation path to achieve better feature parity with Postgres. Here is an example query in `postgreSQL/join.sql`:

      select * from
        text_tbl t1
        left join int8_tbl i8
        on i8.q2 = 123,
        lateral (select i8.q1, t2.f1 from text_tbl t2 limit 1) as ss
      where t1.f1 = ss.f1;
      

      Attachments

        Issue Links

          Activity

            People

              allisonwang-db Allison Wang
              allisonwang-db Allison Wang
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: