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

Add an alternative match pattern for SemiJoinRule

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.11.0
    • 1.12.0
    • core
    • 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.

      Attachments

        Activity

          People

            maryannxue Wei Xue
            maryannxue Wei Xue
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: