You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2021/09/30 02:32:37 UTC

[GitHub] [shardingsphere] strongduanmu commented on a change in pull request #12835: Modify the initialization of the volcano planner

strongduanmu commented on a change in pull request #12835:
URL: https://github.com/apache/shardingsphere/pull/12835#discussion_r719011916



##########
File path: shardingsphere-infra/shardingsphere-infra-optimize/src/main/java/org/apache/shardingsphere/infra/optimize/planner/QueryOptimizePlannerFactory.java
##########
@@ -20,41 +20,44 @@
 import lombok.AccessLevel;
 import lombok.NoArgsConstructor;
 import org.apache.calcite.adapter.enumerable.EnumerableRules;
+import org.apache.calcite.interpreter.Bindables;
 import org.apache.calcite.plan.ConventionTraitDef;
 import org.apache.calcite.plan.RelOptPlanner;
 import org.apache.calcite.plan.volcano.VolcanoPlanner;
-import org.apache.calcite.rel.rules.CoreRules;
 
 /**
  * Query optimize planner factory.
  */
 @NoArgsConstructor(access = AccessLevel.PRIVATE)
 public final class QueryOptimizePlannerFactory {
-    
+
     /**
      * Create new instance of query optimize planner.
-     * 
+     *
      * @return new instance of query optimize planner
      */
     public static RelOptPlanner newInstance() {
         RelOptPlanner result = createPlanner();
         setUpRules(result);
         return result;
     }
-    
+
     private static RelOptPlanner createPlanner() {
-        // TODO consider about HepPlanner
         return new VolcanoPlanner();
     }
-    
+
     private static void setUpRules(final RelOptPlanner planner) {
-        planner.addRule(CoreRules.PROJECT_TO_CALC);
-        planner.addRule(CoreRules.FILTER_TO_CALC);
-        planner.addRule(EnumerableRules.ENUMERABLE_LIMIT_RULE);
-        planner.addRule(EnumerableRules.ENUMERABLE_JOIN_RULE);
-        planner.addRule(EnumerableRules.ENUMERABLE_SORT_RULE);
-        planner.addRule(EnumerableRules.ENUMERABLE_TABLE_SCAN_RULE);
-        planner.addRule(EnumerableRules.ENUMERABLE_CALC_RULE);
         planner.addRelTraitDef(ConventionTraitDef.INSTANCE);
+        planner.addRule(EnumerableRules.TO_INTERPRETER);

Review comment:
       @wgy8283335 What is the function of EnumerableRules.TO_INTERPRETER?

##########
File path: shardingsphere-infra/shardingsphere-infra-optimize/src/main/java/org/apache/shardingsphere/infra/optimize/planner/QueryOptimizePlannerFactory.java
##########
@@ -20,41 +20,44 @@
 import lombok.AccessLevel;
 import lombok.NoArgsConstructor;
 import org.apache.calcite.adapter.enumerable.EnumerableRules;
+import org.apache.calcite.interpreter.Bindables;
 import org.apache.calcite.plan.ConventionTraitDef;
 import org.apache.calcite.plan.RelOptPlanner;
 import org.apache.calcite.plan.volcano.VolcanoPlanner;
-import org.apache.calcite.rel.rules.CoreRules;
 
 /**
  * Query optimize planner factory.
  */
 @NoArgsConstructor(access = AccessLevel.PRIVATE)
 public final class QueryOptimizePlannerFactory {
-    

Review comment:
       @wgy8283335 Can you import the official settings file to avoid different formats?

##########
File path: shardingsphere-infra/shardingsphere-infra-optimize/src/main/java/org/apache/shardingsphere/infra/optimize/planner/QueryOptimizePlannerFactory.java
##########
@@ -20,41 +20,44 @@
 import lombok.AccessLevel;
 import lombok.NoArgsConstructor;
 import org.apache.calcite.adapter.enumerable.EnumerableRules;
+import org.apache.calcite.interpreter.Bindables;
 import org.apache.calcite.plan.ConventionTraitDef;
 import org.apache.calcite.plan.RelOptPlanner;
 import org.apache.calcite.plan.volcano.VolcanoPlanner;
-import org.apache.calcite.rel.rules.CoreRules;
 
 /**
  * Query optimize planner factory.
  */
 @NoArgsConstructor(access = AccessLevel.PRIVATE)
 public final class QueryOptimizePlannerFactory {
-    
+
     /**
      * Create new instance of query optimize planner.
-     * 
+     *
      * @return new instance of query optimize planner
      */
     public static RelOptPlanner newInstance() {
         RelOptPlanner result = createPlanner();
         setUpRules(result);
         return result;
     }
-    
+

Review comment:
       @wgy8283335 Can you import the official settings file to avoid different formats?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org