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

Danny Chen commented on CALCITE-3757:
-------------------------------------

Check the usage of method RelSubSet#getRels(like many one in VolcanoPlanner), i 
didn't found any persuasive evidence why we must return rels that satisfy the 
subset traits instead of equals, because the RelSet#getSubSet identify a 
RelSubSet with equals:

{code:java}
public RelSubset getSubset(RelTraitSet traits) {
    for (RelSubset subset : subsets) {
      if (subset.getTraitSet().equals(traits)) {
        return subset;
      }
    }
    return null;
  }
{code}
So, based on the comment of RelSubSet#getRels, i think we should return exactly 
the rels that have same traits with the subset itself.

> When merging sets, relnodes may be reregistered multiple times
> --------------------------------------------------------------
>
>                 Key: CALCITE-3757
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3757
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>            Reporter: Haisheng Yuan
>            Priority: Major
>
> In RelSet#mergeWith(), 
> {code:java}
> // merge subsets
>     for (RelSubset otherSubset : otherSet.subsets) {
>       ......
>       for (RelNode otherRel : otherSubset.getRels()) {
>         planner.reregister(this, otherRel);
>       }
>     }
> {code}
> otherSubset.getRels() returns all the rels that satisfy the traitset. A 
> relnode's traitset may satisfy many traitsets, hence it will be reregistered 
> multiple times.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to