Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-1055

SubQueryRemoveRule should create Correlate, not Join, for correlated sub-queries

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.6.0
    • Component/s: None
    • Labels:
      None

      Description

      In some cases of FILTER correlated subqueries, the "variablesSet" didn't get passed down to RelBuilder.join() and thus a Join rel was created while it should have been a Correlate rel.
      For example,

      select order_id, quantity from orders o
      where quantity = (
          select max(quantity) from orders o2
          where o.item_id = o2.item_id)
      

      Does the same apply to PROJECT and JOIN subqueries, Julian Hyde ?

        Attachments

        1. CALCITE-1055_2.patch
          4 kB
          Maryann Xue
        2. CALCITE-1055.patch
          1 kB
          Maryann Xue

          Issue Links

            Activity

              People

              • Assignee:
                maryannxue Maryann Xue
                Reporter:
                maryannxue Maryann Xue
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: