You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Sanjai Verma (JIRA)" <ji...@apache.org> on 2017/06/14 13:01:00 UTC

[jira] [Updated] (CALCITE-1839) There is any way to rewrite and forceful remove Join,Filter etc.. from RelNode or SqlNode?

     [ https://issues.apache.org/jira/browse/CALCITE-1839?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sanjai Verma updated CALCITE-1839:
----------------------------------
    Description: 
I have a sql Query :
select a.addr, b.src from a inner join b  on a.cust_id=b.cust_id where b.cust_id=1

I convert the query to SqlNode than optimize  RelNode:

LogicalProject(addr=[$0], src=[$24])
  LogicalJoin(condition=[=($17, $47)], joinType=[inner])
    LogicalFilter(condition=[=($17, 1)])
      JdbcTableScan(table=[[, a]])
    LogicalFilter(condition=[=($26, 1)])
      JdbcTableScan(table=[[, b]])

It is ok.Calcite provide me a optimized query...
but i have another table c with fields addr,src as in table a and b.

I want to rewrite the query:

select c.addr,c.src from c where c.cust_id=1

Is possible ?



> There is any way to rewrite and forceful remove Join,Filter etc.. from RelNode or SqlNode?
> ------------------------------------------------------------------------------------------
>
>                 Key: CALCITE-1839
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1839
>             Project: Calcite
>          Issue Type: Improvement
>            Reporter: Sanjai Verma
>            Assignee: Julian Hyde
>            Priority: Minor
>
> I have a sql Query :
> select a.addr, b.src from a inner join b  on a.cust_id=b.cust_id where b.cust_id=1
> I convert the query to SqlNode than optimize  RelNode:
> LogicalProject(addr=[$0], src=[$24])
>   LogicalJoin(condition=[=($17, $47)], joinType=[inner])
>     LogicalFilter(condition=[=($17, 1)])
>       JdbcTableScan(table=[[, a]])
>     LogicalFilter(condition=[=($26, 1)])
>       JdbcTableScan(table=[[, b]])
> It is ok.Calcite provide me a optimized query...
> but i have another table c with fields addr,src as in table a and b.
> I want to rewrite the query:
> select c.addr,c.src from c where c.cust_id=1
> Is possible ?



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)