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

Introduce a Rule to infer predicates from equi join conditions.

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.9.0-incubating
    • Component/s: None
    • Labels:
      None

      Description

      This is along the lines of the TransitivePredicate inference Rule in Hive.
      For e.g. for

      select 1 from sales.emp d inner join sales.emp e 
      on d.deptno = e.deptno where e.deptno > 7
      

      we can infer

      ProjectRel(EXPR$0=[1])
        JoinRel(condition=[=($7, $16)], joinType=[inner])
          FilterRel(condition=[>($7, 7)])
            TableAccessRel(table=[[CATALOG, SALES, EMP]])
          FilterRel(condition=[>($7, 7)])
            TableAccessRel(table=[[CATALOG, SALES, EMP]])
      

      More egs in the patch. We can do better than Hive: by pulling up Predicates that are effective above every RelNode and inferring new Predicates for the other side of a Join.

      1. OPTIQ-360.1.patch
        61 kB
        Harish Butani

        Issue Links

          Activity

          Show
          julianhyde Julian Hyde added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/incubator-optiq/commit/c33e602f .
          Hide
          julianhyde Julian Hyde added a comment -

          Close issues resolved in release 0.9.0-incubating (2014-08-25).

          Show
          julianhyde Julian Hyde added a comment - Close issues resolved in release 0.9.0-incubating (2014-08-25).

            People

            • Assignee:
              julianhyde Julian Hyde
              Reporter:
              rhbutani Harish Butani
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development