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/04/20 08:24:00 UTC

[jira] [Updated] (CALCITE-4512) group by expression has argument name same with select list item alias, causes validation error

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

yanjing.wang updated CALCITE-4512:
----------------------------------
    Summary: group by expression has argument name same with select list item alias, causes validation error  (was: 'case when' project alias equals 'when condition column name or then column name' causes validation error)

> group by expression has argument name same with select list item alias, causes validation error
> -----------------------------------------------------------------------------------------------
>
>                 Key: CALCITE-4512
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4512
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.26.0
>         Environment: jvm: open-jdk8
>            Reporter: yanjing.wang
>            Priority: Major
>             Fix For: 1.27.0
>
>
> String sql = "select replace(name, 'a', 'b') as name from users group by replace(name, 'a', 'b')";
>  
> when group by expression has argument name same with select list item alias, the group by argument will be expanded to select list item when sql conformance supports 'groupByAlias', so the above sql will be expanded to 
> String sql = "select replace(name, 'a', 'b') as name from users group by replace(replace(name, 'a', 'b'), 'a', 'b')";
>  
> this is unexpected.



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