[ 
https://issues.apache.org/jira/browse/CALCITE-5521?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

asdfgh19 updated CALCITE-5521:
------------------------------
    Description: 
{code:java}
void add(RelNode rel) {
  if (set.rels.contains(rel)) {
    return;
  }

  VolcanoPlanner planner = (VolcanoPlanner) rel.getCluster().getPlanner();
  if (planner.getListener() != null) {
    RelOptListener.RelEquivalenceEvent event =
        new RelOptListener.RelEquivalenceEvent(
            planner,
            rel,
            this,
            true);
    planner.getListener().relEquivalenceFound(event);
  }

  // If this isn't the first rel in the set, it must have compatible
  // row type.
  if (set.rel != null) {
    RelOptUtil.equal("rowtype of new rel", rel.getRowType(),
        "rowtype of set", getRowType(), Litmus.THROW);
  }
  set.addInternal(rel);
  if (false) {
    Set<CorrelationId> variablesSet = RelOptUtil.getVariablesSet(rel);
    Set<CorrelationId> variablesStopped = rel.getVariablesSet();
    Set<CorrelationId> variablesPropagated =
        Util.minus(variablesSet, variablesStopped);
    assert set.variablesPropagated.containsAll(variablesPropagated);
    Set<CorrelationId> variablesUsed = RelOptUtil.getVariablesUsed(rel);
    assert set.variablesUsed.containsAll(variablesUsed);
  }
} {code}
!未命名文件 (4).png|width=741,height=451!

Double checking relset rowtype and input parameter relNode rowtype may be 
unnecessary

  was:
!未命名文件 (4).png|width=741,height=451!

Double checking relset rowtype and input parameter relNode rowtype may be 
unnecessary


> Remove redundant rowtype double checks in RelSubset#add
> -------------------------------------------------------
>
>                 Key: CALCITE-5521
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5521
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>            Reporter: asdfgh19
>            Priority: Minor
>             Fix For: 1.33.0
>
>         Attachments: 未命名文件 (4).png
>
>
> {code:java}
> void add(RelNode rel) {
>   if (set.rels.contains(rel)) {
>     return;
>   }
>   VolcanoPlanner planner = (VolcanoPlanner) rel.getCluster().getPlanner();
>   if (planner.getListener() != null) {
>     RelOptListener.RelEquivalenceEvent event =
>         new RelOptListener.RelEquivalenceEvent(
>             planner,
>             rel,
>             this,
>             true);
>     planner.getListener().relEquivalenceFound(event);
>   }
>   // If this isn't the first rel in the set, it must have compatible
>   // row type.
>   if (set.rel != null) {
>     RelOptUtil.equal("rowtype of new rel", rel.getRowType(),
>         "rowtype of set", getRowType(), Litmus.THROW);
>   }
>   set.addInternal(rel);
>   if (false) {
>     Set<CorrelationId> variablesSet = RelOptUtil.getVariablesSet(rel);
>     Set<CorrelationId> variablesStopped = rel.getVariablesSet();
>     Set<CorrelationId> variablesPropagated =
>         Util.minus(variablesSet, variablesStopped);
>     assert set.variablesPropagated.containsAll(variablesPropagated);
>     Set<CorrelationId> variablesUsed = RelOptUtil.getVariablesUsed(rel);
>     assert set.variablesUsed.containsAll(variablesUsed);
>   }
> } {code}
> !未命名文件 (4).png|width=741,height=451!
> Double checking relset rowtype and input parameter relNode rowtype may be 
> unnecessary



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

Reply via email to