[
https://issues.apache.org/jira/browse/CALCITE-7909?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18145281#comment-18145281
]
Sergey Nuyanzin commented on CALCITE-7909:
------------------------------------------
Merged as
[5f48eec8d5e3f25df641393c9440e086646868b7|https://github.com/apache/calcite/commit/5f48eec8d5e3f25df641393c9440e086646868b7]
> ProjectSetOpTransposeRule returns wrong results for EXCEPT ALL and INTERSECT
> ALL
> --------------------------------------------------------------------------------
>
> Key: CALCITE-7909
> URL: https://issues.apache.org/jira/browse/CALCITE-7909
> Project: Calcite
> Issue Type: Bug
> Components: core
> Reporter: Sergey Nuyanzin
> Assignee: Sergey Nuyanzin
> Priority: Major
> Labels: pull-request-available
>
> ProjectSetOpTransposeRule pushes a Project below any SetOp with all = true.
> That is only correct for UNION ALL. EXCEPT ALL and INTERSECT ALL decide which
> rows to keep by comparing whole rows. If the project removes columns first,
> rows that were different can become equal.
> {code:sql}
> SELECT y FROM (
> SELECT x + 1 AS x, y FROM (VALUES (1, 10)) AS a(x, y)
> EXCEPT ALL
> SELECT x + 1 AS x, y FROM (VALUES (2, 10)) AS b(x, y));
> {code}
> currently returns no rows while expected {{10}}
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)