use of org.apache.drill.exec.planner.physical.DrillDistributionTrait in project drill by apache.
the class AbstractIndexPlanGenerator method createRangeDistRight.
// Range distribute the right side of the join, on row keys using a range partitioning function
protected RelNode createRangeDistRight(final RelNode rightPrel, final RelDataTypeField rightRowKeyField, final DbGroupScan origDbGroupScan) {
List<DrillDistributionTrait.DistributionField> rangeDistFields = Lists.newArrayList(new DrillDistributionTrait.DistributionField(0));
FieldReference rangeDistRef = FieldReference.getWithQuotedRef(rightRowKeyField.getName());
List<FieldReference> rangeDistRefList = Lists.newArrayList();
rangeDistRefList.add(rangeDistRef);
final DrillDistributionTrait distRight;
if (IndexPlanUtils.scanIsPartition(origDbGroupScan)) {
distRight = new DrillDistributionTrait(DrillDistributionTrait.DistributionType.RANGE_DISTRIBUTED, ImmutableList.copyOf(rangeDistFields), origDbGroupScan.getRangePartitionFunction(rangeDistRefList));
} else {
distRight = DrillDistributionTrait.SINGLETON;
}
RelTraitSet rightTraits = newTraitSet(distRight).plus(Prel.DRILL_PHYSICAL);
RelNode convertedRight = Prule.convert(rightPrel, rightTraits);
return convertedRight;
}
Aggregations