DRILL-1132: WriterPrel should not care about collation trait of the child.

Project: http://git-wip-us.apache.org/repos/asf/incubator-drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-drill/commit/a6d74f5d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-drill/tree/a6d74f5d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-drill/diff/a6d74f5d

Branch: refs/heads/master
Commit: a6d74f5d1ea03314119a1b404a515251fd246a3f
Parents: de05070
Author: Aman Sinha <[email protected]>
Authored: Fri Aug 22 12:01:39 2014 -0700
Committer: Jacques Nadeau <[email protected]>
Committed: Sun Aug 24 12:04:29 2014 -0700

----------------------------------------------------------------------
 .../apache/drill/exec/planner/physical/WriterPrule.java  | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/a6d74f5d/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/WriterPrule.java
----------------------------------------------------------------------
diff --git 
a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/WriterPrule.java
 
b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/WriterPrule.java
index 15d94fb..f3057e6 100644
--- 
a/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/WriterPrule.java
+++ 
b/exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/WriterPrule.java
@@ -21,13 +21,10 @@ import 
org.apache.drill.exec.planner.common.DrillWriterRelBase;
 import org.apache.drill.exec.planner.logical.DrillRel;
 import org.apache.drill.exec.planner.logical.DrillWriterRel;
 import org.apache.drill.exec.planner.logical.RelOptHelper;
-import org.eigenbase.rel.RelCollation;
-import org.eigenbase.rel.RelCollationTraitDef;
 import org.eigenbase.rel.RelNode;
 import org.eigenbase.relopt.RelOptRule;
 import org.eigenbase.relopt.RelOptRuleCall;
 import org.eigenbase.relopt.RelTraitSet;
-import org.eigenbase.relopt.volcano.RelSubset;
 
 public class WriterPrule extends Prule{
   public static final RelOptRule INSTANCE = new WriterPrule();
@@ -62,10 +59,14 @@ public class WriterPrule extends Prule{
     @Override
     public RelNode convertChild(DrillWriterRelBase writer, RelNode rel) throws 
RuntimeException {
       DrillDistributionTrait childDist = 
rel.getTraitSet().getTrait(DrillDistributionTraitDef.INSTANCE);
-      RelCollation childCollation = 
rel.getTraitSet().getTrait(RelCollationTraitDef.INSTANCE);
 
+      // Create the Writer with the child's distribution because the degree of 
parallelism for the writer 
+      // should correspond to the number of child minor fragments. The Writer 
itself is not concerned with 
+      // the collation of the child.  Note that the Writer's output RowType 
consists of 
+      // {fragment_id varchar(255), number_of_records_written bigint} which 
are very different from the 
+      // child's output RowType. 
       return new WriterPrel(writer.getCluster(),
-          
writer.getTraitSet().plus(childDist).plus(childCollation).plus(Prel.DRILL_PHYSICAL),
+          writer.getTraitSet().plus(childDist).plus(Prel.DRILL_PHYSICAL),
           rel, writer.getCreateTableEntry());
     }
 

Reply via email to