paul-rogers commented on a change in pull request #2002: DRILL-7587: Fix 
ValuesPrule distribution trait type
URL: https://github.com/apache/drill/pull/2002#discussion_r385999119
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/ValuesPrule.java
 ##########
 @@ -17,25 +17,23 @@
  */
 package org.apache.drill.exec.planner.physical;
 
-import org.apache.calcite.plan.RelOptRule;
-import org.apache.drill.exec.planner.logical.DrillRelFactories;
+import org.apache.calcite.plan.RelOptRuleCall;
+import org.apache.drill.exec.planner.logical.DrillRel;
 import org.apache.drill.exec.planner.logical.DrillValuesRel;
 import org.apache.drill.exec.planner.logical.RelOptHelper;
-import org.apache.calcite.plan.RelOptRuleCall;
 
-public class ValuesPrule extends RelOptRule {
+public class ValuesPrule extends Prule {
 
   public static final ValuesPrule INSTANCE = new ValuesPrule();
 
   private ValuesPrule() {
-    super(RelOptHelper.any(DrillValuesRel.class), 
DrillRelFactories.LOGICAL_BUILDER, "Prel.ValuesPrule");
+    super(RelOptHelper.any(DrillValuesRel.class, DrillRel.DRILL_LOGICAL), 
"Prel.ValuesPrule");
   }
 
   @Override
   public void onMatch(final RelOptRuleCall call) {
-    final DrillValuesRel rel = call.rel(0);
+    DrillValuesRel rel = call.rel(0);
     call.transformTo(new ValuesPrel(rel.getCluster(), rel.getRowType(), 
rel.getTuples(),
-        rel.getTraitSet().plus(Prel.DRILL_PHYSICAL), rel.getContent()));
+      
rel.getTraitSet().plus(Prel.DRILL_PHYSICAL).plus(DrillDistributionTrait.SINGLETON),
 rel.getContent()));
 
 Review comment:
   Maybe add a comment that explains the reason, such as the PR explanation?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to