You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Jesus Camacho Rodriguez (JIRA)" <ji...@apache.org> on 2015/06/16 20:52:00 UTC

[jira] [Resolved] (CALCITE-753) Aggregate operators may derive row types with duplicate column names

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

Jesus Camacho Rodriguez resolved CALCITE-753.
---------------------------------------------
       Resolution: Fixed
    Fix Version/s: 1.4.0-incubating

Fixed in http://git-wip-us.apache.org/repos/asf/incubator-calcite/commit/ccdda9b2

> Aggregate operators may derive row types with duplicate column names
> --------------------------------------------------------------------
>
>                 Key: CALCITE-753
>                 URL: https://issues.apache.org/jira/browse/CALCITE-753
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Jesus Camacho Rodriguez
>            Assignee: Jesus Camacho Rodriguez
>             Fix For: 1.4.0-incubating
>
>
> Aggregate operators may derive row types with duplicate column names. The reason is that the column names for grouping sets columns and aggregation columns might be generated automatically, but we do not check whether the column name already exists in the same row.
> This condition may appear e.g. in the following plan:
> {noformat}
> Aggregate (f1, sum(f1)) 
>   Union
>     Aggregate (x, sum(x)) ...
>     Aggregate (x, sum(x))  ...
> {noformat}
> where _f1_ is the column with the result of sum(_x_).
> Calcite derives the row schema for the aggregation column sum(_f1_) automatically. The generated name is _f1_ ('f' of function, '1' of the position in the tuple), which is the same one that the first column has; however, Calcite is not verifying if the autogenerated name was already in the tuple or not. This patch checks if the name already exists, and while it does, it generates a new column name.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)