[
https://issues.apache.org/jira/browse/CALCITE-7934?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18143244#comment-18143244
]
Etienne Pelissier commented on CALCITE-7934:
--------------------------------------------
The fix belongs in RelMdUniqueKeys and RelMdColumnUniqueness.
I will start working on a PR once the ticket is validated.
> Aggregate uniqueness metadata uses incorrect column ordinals
> ------------------------------------------------------------
>
> Key: CALCITE-7934
> URL: https://issues.apache.org/jira/browse/CALCITE-7934
> Project: Calcite
> Issue Type: Bug
> Components: core
> Reporter: Etienne Pelissier
> Priority: Major
>
> Broken quidem test:
> {code:java}
> !set hep-rules "
> +CoreRules.AGGREGATE_PROJECT_MERGE,
> +CoreRules.AGGREGATE_REMOVE"
> select distinct count(*) filter (where col1) as s
> from (values
> (true, 1),
> (true, 2)) as t(col1, col2)
> group by col2;
> +---+
> | S |
> +---+
> | 1 |
> +---+
> (1 row){code}
> The result produced by Calcite contains two rows instead of one.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)