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

suibianwanwan commented on CALCITE-6611:
----------------------------------------

[~caicancai] While solving [CALCITE-6586], some problems were encountered that 
caused some tests to fail. The first two PRs are to fix these problems. Since 
they are small and some CASEs are harder to reproduce without [CALCITE-6586], I 
did not create a new JIRA CASE and submit a separate PR.
Also, I added this JIRA bug in [PR-3994]
Bug:
{code:java}
/** Whether
 * <a href="https://issues.apache.org/jira/browse/CALCITE-6611";>[CALCITE-6611]
 * Rules that modify the sort collation cannot be applied in VolcanoPlanner</a>
 * is fixed. */
public static final boolean CALCITE_6611_FIXED = false; {code}
SortRemoveConstantKeysRule:
{code:java}
if (!Bug.CALCITE_6611_FIXED) {
  if (call.getPlanner().getRelTraitDefs()
      .contains(RelCollationTraitDef.INSTANCE)) {
    return;
  }
}{code}

> Rules that modify the sort collation cannot be applied in VolcanoPlanner
> ------------------------------------------------------------------------
>
>                 Key: CALCITE-6611
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6611
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: suibianwanwan
>            Priority: Critical
>
> In VolcanoPlanner, the input to a RelNode is RelSubset, and when connecting 
> nodes, the TraitSet that looks up the input in the RelSet it belongs to looks 
> up the RelNode that satisfies it.
> If we modify the TraitSet of a relNode and register the new relNode in the 
> VolcanoPlanner, the new relNode will not be selected by the parent. 
> Take SortRemoveConstantKeyRule as an example, suppose the original ordering 
> is [0,1]. 
> If we optimize the order to [1], then because the input of the parent is 
> RelSubset([0,1]), the parent will not choose the RelNode after applying the 
> rule.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to