You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by hy...@apache.org on 2019/11/15 19:13:15 UTC

[calcite] branch master updated: [CALCITE-3491] Remove unused method VolcanoPlanner.completeConversion() (Xiening Dai)

This is an automated email from the ASF dual-hosted git repository.

hyuan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/calcite.git


The following commit(s) were added to refs/heads/master by this push:
     new 301bbe9  [CALCITE-3491] Remove unused method VolcanoPlanner.completeConversion() (Xiening Dai)
301bbe9 is described below

commit 301bbe9e132346f60587e8c21c474f7c51b236c3
Author: Xiening Dai <xn...@live.com>
AuthorDate: Thu Nov 14 13:37:11 2019 -0800

    [CALCITE-3491] Remove unused method VolcanoPlanner.completeConversion() (Xiening Dai)
    
    Close #1586
---
 .../calcite/plan/volcano/VolcanoPlanner.java       | 67 +---------------------
 1 file changed, 2 insertions(+), 65 deletions(-)

diff --git a/core/src/main/java/org/apache/calcite/plan/volcano/VolcanoPlanner.java b/core/src/main/java/org/apache/calcite/plan/volcano/VolcanoPlanner.java
index c592290..bcbb380 100644
--- a/core/src/main/java/org/apache/calcite/plan/volcano/VolcanoPlanner.java
+++ b/core/src/main/java/org/apache/calcite/plan/volcano/VolcanoPlanner.java
@@ -19,7 +19,6 @@ package org.apache.calcite.plan.volcano;
 import org.apache.calcite.avatica.util.Spaces;
 import org.apache.calcite.config.CalciteConnectionConfig;
 import org.apache.calcite.config.CalciteSystemProperty;
-import org.apache.calcite.linq4j.tree.Expressions;
 import org.apache.calcite.plan.AbstractRelOptPlanner;
 import org.apache.calcite.plan.Context;
 import org.apache.calcite.plan.Convention;
@@ -1054,16 +1053,8 @@ public class VolcanoPlanner extends AbstractRelOptPlanner {
               allowInfiniteCostConverters);
       if (rel != null) {
         assert rel.getTraitSet().getTrait(traitDef).satisfies(toTrait);
-        rel =
-            completeConversion(
-                rel, allowInfiniteCostConverters, toTraits,
-                Expressions.list(traitDef));
-        if (rel != null) {
-          register(rel, converted);
-        }
-      }
-
-      if ((rel == null) && allowAbstractConverters) {
+        register(rel, converted);
+      } else if (allowAbstractConverters) {
         RelTraitSet stepTraits =
             converted.getTraitSet().replace(toTrait);
 
@@ -1081,60 +1072,6 @@ public class VolcanoPlanner extends AbstractRelOptPlanner {
     return converted;
   }
 
-  /**
-   * Converts traits using well-founded induction. We don't require that
-   * each conversion preserves all traits that have previously been converted,
-   * but if it changes "locked in" traits we'll try some other conversion.
-   *
-   * @param rel                         Relational expression
-   * @param allowInfiniteCostConverters Whether to allow infinite converters
-   * @param toTraits                    Target trait set
-   * @param usedTraits                  Traits that have been locked in
-   * @return Converted relational expression
-   */
-  private RelNode completeConversion(
-      RelNode rel,
-      boolean allowInfiniteCostConverters,
-      RelTraitSet toTraits,
-      Expressions.FluentList<RelTraitDef> usedTraits) {
-    if (true) {
-      return rel;
-    }
-    for (RelTrait trait : rel.getTraitSet()) {
-      if (toTraits.contains(trait)) {
-        // We're already a match on this trait type.
-        continue;
-      }
-      final RelTraitDef traitDef = trait.getTraitDef();
-      RelNode rel2 =
-          traitDef.convert(
-              this,
-              rel,
-              toTraits.getTrait(traitDef),
-              allowInfiniteCostConverters);
-
-      // if any of the used traits have been knocked out, we could be
-      // heading for a cycle.
-      for (RelTraitDef usedTrait : usedTraits) {
-        if (!rel2.getTraitSet().contains(usedTrait)) {
-          continue;
-        }
-      }
-      // recursive call, to convert one more trait
-      rel =
-          completeConversion(
-              rel2,
-              allowInfiniteCostConverters,
-              toTraits,
-              usedTraits.append(traitDef));
-      if (rel != null) {
-        return rel;
-      }
-    }
-    assert rel.getTraitSet().equals(toTraits);
-    return rel;
-  }
-
   RelNode changeTraitsUsingConverters(
       RelNode rel,
       RelTraitSet toTraits) {