You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "yanjing.wang (Jira)" <ji...@apache.org> on 2021/11/26 07:05:00 UTC

[jira] [Commented] (CALCITE-2718) field names are unexpected after ProjectRemoveRule applied

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

yanjing.wang commented on CALCITE-2718:
---------------------------------------

Hi, Julian, I encountered the same problem, I wonder if it means that I need replace the top project with original plan row type if I want to get a sql with same semantics with the original plan.

> field names are unexpected after ProjectRemoveRule applied
> ----------------------------------------------------------
>
>                 Key: CALCITE-2718
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2718
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.17.0
>            Reporter: godfrey he
>            Assignee: Julian Hyde
>            Priority: Major
>             Fix For: 1.18.0
>
>
> {code:java}
> @Test public void testProjectRemove() {
>     final String sql = "select name as n from (select name from dept) t";
>     sql(sql).withRule(ProjectRemoveRule.INSTANCE).check();
>   }
> {code}
> currently, the result plan is: 
> {panel:title=plan}
> LogicalProject(NAME=[$1])
>   LogicalTableScan(table=[[CATALOG, SALES, DEPT]])
> {panel}
> the filed name of LogicalProject should be `N` instead of `NAME`



--
This message was sent by Atlassian Jira
(v8.20.1#820001)