[
https://issues.apache.org/jira/browse/CALCITE-4149?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17172788#comment-17172788
]
Jiatao Tao commented on CALCITE-4149:
-------------------------------------
[~julianhyde]
It's really hard for us to archive this as we use calcite as an adapter to
other computer engines as I mentioned in CALCITE-4160.
In your mind, just add this constrain in ProjectRemoveRule would have some bad
effect when optimizing?
> 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)