aboutsummaryrefslogtreecommitdiff
path: root/exec
diff options
context:
space:
mode:
authorAman Sinha <asinha@maprtech.com>2014-08-22 12:01:39 -0700
committerJacques Nadeau <jacques@apache.org>2014-08-24 12:04:29 -0700
commita6d74f5d1ea03314119a1b404a515251fd246a3f (patch)
tree3ace83b6e5278e4e553a1e1a48a309a3503e6c49 /exec
parentde05070cc41271ba12ae5bfede27ab12993be564 (diff)
DRILL-1132: WriterPrel should not care about collation trait of the child.
Diffstat (limited to 'exec')
-rw-r--r--exec/java-exec/src/main/java/org/apache/drill/exec/planner/physical/WriterPrule.java11
1 files changed, 6 insertions, 5 deletions
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 15d94fb03..f3057e636 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());
}