Search in sources :

Example 1 with DrillLateralJoinRel

use of org.apache.drill.exec.planner.logical.DrillLateralJoinRel in project drill by apache.

the class LateralJoinPrule method onMatch.

@Override
public void onMatch(RelOptRuleCall call) {
    final DrillLateralJoinRel lateralJoinRel = call.rel(0);
    final RelNode left = lateralJoinRel.getLeft();
    final RelNode right = lateralJoinRel.getRight();
    RelTraitSet traitsLeft = left.getTraitSet().plus(Prel.DRILL_PHYSICAL);
    RelTraitSet traitsRight = right.getTraitSet().plus(Prel.DRILL_PHYSICAL);
    RelTraitSet corrTraits = traitsLeft.plus(DrillDistributionTrait.RANDOM_DISTRIBUTED);
    final RelNode convertedLeft = convert(left, traitsLeft);
    final RelNode convertedRight = convert(right, traitsRight);
    final LateralJoinPrel lateralJoinPrel = new LateralJoinPrel(lateralJoinRel.getCluster(), corrTraits, convertedLeft, convertedRight, lateralJoinRel.excludeCorrelateColumn, lateralJoinRel.getCorrelationId(), lateralJoinRel.getRequiredColumns(), lateralJoinRel.getJoinType());
    call.transformTo(lateralJoinPrel);
}
Also used : RelNode(org.apache.calcite.rel.RelNode) DrillLateralJoinRel(org.apache.drill.exec.planner.logical.DrillLateralJoinRel) RelTraitSet(org.apache.calcite.plan.RelTraitSet)

Aggregations

RelTraitSet (org.apache.calcite.plan.RelTraitSet)1 RelNode (org.apache.calcite.rel.RelNode)1 DrillLateralJoinRel (org.apache.drill.exec.planner.logical.DrillLateralJoinRel)1