[ 
https://issues.apache.org/jira/browse/CALCITE-7938?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18145404#comment-18145404
 ] 

Etienne Pelissier commented on CALCITE-7938:
--------------------------------------------

This seems related to:
 * [CALCITE-2593|https://issues.apache.org/jira/browse/CALCITE-2593], 
"Sometimes fails to plan when a RelNode transforms multiple collations to a 
single collation"
 * [CALCITE-6611|https://issues.apache.org/jira/browse/CALCITE-6611], "Rules 
that modify the sort collation cannot be applied in VolcanoPlanner"
 * [CALCITE-6899|https://issues.apache.org/jira/browse/CALCITE-6899], "Mismatch 
of Trait information results in a missing conversion exception"

The fix proposed in my PR is a workaround. I believe the cleaner fix would be 
addressing the "When Volcano registers the LogicalValues, its composite 
collation [[0, 1], [1]] is simplified to the default NONE.[] subset" part.

I look forward to hearing your opinions.

> AggregateRemoveRule can cause failed planning because of collation mismatch
> ---------------------------------------------------------------------------
>
>                 Key: CALCITE-7938
>                 URL: https://issues.apache.org/jira/browse/CALCITE-7938
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>            Reporter: Etienne Pelissier
>            Assignee: Etienne Pelissier
>            Priority: Major
>              Labels: pull-request-available
>
> *NB*: I need advices regarding the right fix. See comments.
> Broken quidem test:
> {code}
> !set hep-rules "
> +CoreRules.AGGREGATE_PROJECT_MERGE,
> +CoreRules.AGGREGATE_REMOVE"
> select count(*) as s
> from (values (true, 1), (true, 2)) as t(col1, col2)
> where col1
> group by col2;
> +---+
> | S |
> +---+
> | 1 |
> | 1 |
> +---+
> (2 rows)
> !ok
> {code}
> The query fails with:
> {code}
> There are not enough rules to produce a node with desired properties
> There is 1 empty subset: ... ENUMERABLE.[0]
> {code}
> The issue is reproducible beyond VALUES, I have a JUnit reproducer ready.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to