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

LakeShen commented on CALCITE-6070:
-----------------------------------

I think that the alias 'DID' should be keeped after the RelFieldTrimmer.

I test the similar sql in presto,the alias is keeped.So it maybe a bug.

> Incorrect field name after RelFieldTrimmer
> ------------------------------------------
>
>                 Key: CALCITE-6070
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6070
>             Project: Calcite
>          Issue Type: Wish
>          Components: core
>    Affects Versions: 1.35.0
>            Reporter: ZheHu
>            Priority: Minor
>
> Run the following SQL in SqlToRelConverterTest:
> {code}
> select ename as did from emp where ename='a' limit 10
> {code}
> Got planA without RelFieldTrimmer:
> {code}
> LogicalSort(fetch=[10])
>   LogicalProject(DID=[$1])
>     LogicalFilter(condition=[=($1, 'a')])
>       LogicalTableScan(table=[[CATALOG, SALES, EMP]])
> {code}
> Got planB with RelFieldTrimmer:
> {code}
> LogicalSort(fetch=[10])
>   LogicalFilter(condition=[=($0, 'a')])
>     LogicalProject(ENAME=[$1])
>       LogicalTableScan(table=[[CATALOG, SALES, EMP]])
> {code}
> However, the column alia DID for ENAME is missing in planB.
> Maybe we can do something about the trimmer when we have other 
> purposes(renaming column is the only purpose for this case).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to