[ 
https://issues.apache.org/jira/browse/CALCITE-4149?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17169777#comment-17169777
 ] 

Jiatao Tao edited comment on CALCITE-4149 at 8/3/20, 7:30 AM:
--------------------------------------------------------------

Hi, [~julianhyde] RelRoot#project has aliases, the project with alias is 
removed by ProjectRemoveRule in Volcano Planner.

IMO a project with aliases shouldn't be removed within ProjectRemoveRule, cuz 
we may want serialize the plan or convert the plan back to SQL, the alias 
matters, hope to hear your advice.


was (Author: aron.tao):
Hi [~julianhyde] RelRoot#project has aliases, the project with alias is removed 
by ProjectRemoveRule in Volcano Planner. IMO a project with aliases shouldn't 
be removed.

> Missing top project when trim fields
> ------------------------------------
>
>                 Key: CALCITE-4149
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4149
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>            Reporter: Jiatao Tao
>            Assignee: Jiatao Tao
>            Priority: Major
>
> Case like that:
>  
> {code:java}
> @Test void dev() throws SQLException {
>   sql("model", "select t1.name as t1_name, t2.name from EMPS t1 join EMPS t2 
> on t1.name = t2.name").ok();
> }
> {code}
>  
> The plan after RelFieldTrimmer:
> {code:java}
> LogicalJoin(condition=[=($0, $1)], joinType=[inner])
>   LogicalProject(NAME=[$1])
>     LogicalTableScan(table=[[SALES, EMPS]])
>   LogicalProject(NAME=[$1])
>     LogicalTableScan(table=[[SALES, EMPS]])
> {code}
>  
> The top project  is missing, but the query has an alias, the info is lost. 
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to