[
https://issues.apache.org/jira/browse/CALCITE-4700?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Vladimir Ozerov updated CALCITE-4700:
-------------------------------------
Description:
Consider the following tree:
{code}
LogicalAggregate[groupSet=$1, ...]
LogicalUnion
Input
{code}
When the rule is applied, the top-level Aggregate receives the same group set
as the original Aggregate, which is wrong because it points to an incorrect
attribute.
{code}
LogicalAggregate[groupSet=$1, ...] // <- wrong
LogicalUnion
LogicalAggregate[groupSet=$1, ...]
Input
{code}
The correct plan should be:
{code}
LogicalAggregate[groupSet=$0, ...]
LogicalUnion
LogicalAggregate[groupSet=$1, ...]
Input
{code}
> AggregateUnionTransposeRule produces wrong group sets for the top Aggregate
> ---------------------------------------------------------------------------
>
> Key: CALCITE-4700
> URL: https://issues.apache.org/jira/browse/CALCITE-4700
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.28.0
> Reporter: Vladimir Ozerov
> Assignee: Vladimir Ozerov
> Priority: Major
>
> Consider the following tree:
> {code}
> LogicalAggregate[groupSet=$1, ...]
> LogicalUnion
> Input
> {code}
> When the rule is applied, the top-level Aggregate receives the same group set
> as the original Aggregate, which is wrong because it points to an incorrect
> attribute.
> {code}
> LogicalAggregate[groupSet=$1, ...] // <- wrong
> LogicalUnion
> LogicalAggregate[groupSet=$1, ...]
> Input
> {code}
> The correct plan should be:
> {code}
> LogicalAggregate[groupSet=$0, ...]
> LogicalUnion
> LogicalAggregate[groupSet=$1, ...]
> Input
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)