You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Harish Butani (JIRA)" <ji...@apache.org> on 2014/08/05 03:19:13 UTC

[jira] [Created] (OPTIQ-360) Introduce a Rule to infer predicates from equi join conditions.

Harish Butani created OPTIQ-360:
-----------------------------------

             Summary: Introduce a Rule to infer predicates from equi join conditions.
                 Key: OPTIQ-360
                 URL: https://issues.apache.org/jira/browse/OPTIQ-360
             Project: Optiq
          Issue Type: New Feature
            Reporter: Harish Butani
            Assignee: Julian Hyde


This is along the lines of the TransitivePredicate inference Rule in Hive.
For e.g. for
{code}
select 1 from sales.emp d inner join sales.emp e 
on d.deptno = e.deptno where e.deptno > 7
{code}

we can infer
{code}
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]])
{code}

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.



--
This message was sent by Atlassian JIRA
(v6.2#6252)