[
https://issues.apache.org/jira/browse/CALCITE-3889?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17072520#comment-17072520
]
Roman Kondakov commented on CALCITE-3889:
-----------------------------------------
It is a great idea! It also seems to me that there is a bug in
{{RelDistributionImpl#apply}}: if we have HASH distribution by {{keys=\{0,1\}}}
and {{Project(mapping=(2,1,0))}}, calling {{RelDistributionImpl#apply}} here
will produce
{noformat}
IllegalArgumentException("mapping source count=3 does not match list size=2")
{noformat}
It happens when {{keys}} size in {{RelDistributionImpl}} does not equal to the
size of {{Project.projects()}}.
It would be nice if we fix this problem as a part of this ticket.
> Add apply(Mappings.Mapping) to RelTrait and RelTraitSet
> -------------------------------------------------------
>
> Key: CALCITE-3889
> URL: https://issues.apache.org/jira/browse/CALCITE-3889
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Reporter: Haisheng Yuan
> Priority: Major
>
> RelTrait Collation, Distribution have key indices, when we pass down the
> traitset to child or propagate to parent operator, we have to remap these
> keys. It would be nice to have {{apply(Mappings.Mapping)}} on RelTrait and
> RelTraitSet. RelDistribution already has the method, but we may want it on
> every RelTrait except Convention.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)