Gian Merlino created CALCITE-7901:
-------------------------------------
Summary: UnionMergeRule merges EXCEPT ALL into an enclosing EXCEPT
DISTINCT
Key: CALCITE-7901
URL: https://issues.apache.org/jira/browse/CALCITE-7901
Project: Calcite
Issue Type: Bug
Reporter: Gian Merlino
{{CoreRules.MINUS_MERGE}} merges {{Minus(distinct, Minus(all, a, b), c)}} into
{{Minus(distinct, a, b, c)}}, so the query can return wrong results. For
example,
{code:sql}
select x from (values (1), (1), (2)) as t(x)
except all
select x from (values (1)) as t2(x)
except
select x from (values (3)) as t3(x)
{code}
returns {{[2]}} but should return {{[1], [2]}}.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)