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

Add an alternative match pattern for SemiJoinRule

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.11.0
    • Fix Version/s: 1.12.0
    • Component/s: core
    • Labels:
      None

      Description

      SemiJoinRule looks for an INNER or LEFT OUTER Join with its right child as an Aggregate. It also tries to match a Project as the parent of the Join so that it can abort if any columns from the right child of the Join is referenced. There is another situation though, where the right child is an empty Aggregate that returns 0 columns and thus we don't need to look for a Project. So an alternative match pattern for SemiJoinRule would be just a Join over an Aggregate without a Project. For example, the following query can match the alternative pattern and fire the rule:

      select e."deptno" from "hr"."emps" as e left join (select count(*) from "hr"."depts") on true
      

      , where after field trimming the inner query will become an empty Aggregate.

        Activity

        Hide
        julianhyde Julian Hyde added a comment -

        Resolved in release 1.12.0 (2017-03-24).

        Show
        julianhyde Julian Hyde added a comment - Resolved in release 1.12.0 (2017-03-24).
        Show
        maryannxue Maryann Xue added a comment - Fixed in https://git1-us-west.apache.org/repos/asf?p=calcite.git;a=commit;h=824d7e7 .

          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:

              Development