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

Julian Hyde resolved CALCITE-4616.
----------------------------------
    Resolution: Fixed

Fixed in 
[94812771|https://github.com/apache/calcite/commit/948127710f7fb44b795b25dfb4d9c2214c1392c7];
 thanks for the PR, [~vozerov]!

> AggregateUnionTransposeRule causes row type mismatch when some inputs have 
> unique grouping key
> ----------------------------------------------------------------------------------------------
>
>                 Key: CALCITE-4616
>                 URL: https://issues.apache.org/jira/browse/CALCITE-4616
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.26.0
>            Reporter: Vladimir Ozerov
>            Assignee: Vladimir Ozerov
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.28.0
>
>          Time Spent: 2h
>  Remaining Estimate: 0h
>
> Consider the following relational tree:
> {code}
> 1: Aggregate[group=a, SUM(b)]
> 2:   Union
> 3:     Input1[a, b, c]
> 4:     Input2[a, b, c]
> {code}
> It may happen, that {{Input1}} has a unique key on {{[a]}}. In this case, 
> Apache Calcite, will not install the {{Aggregate}} on top of it, which leads 
> to the following tree:
> {code}
> 1: Aggregate[group=a, SUM(b)]
> 2:   Union
> 3:     Input1[a, b, c]
> 4:     Aggregate[group=a, SUM(b)]
> 5:       Input2[a, b, c]
> {code}
> Obviously, the tree is incorrect, because {{Union}} inputs now have different 
> row types.



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

Reply via email to