return PrelUtil.getPlannerSettings(call.getPlanner()).isMergeJoinEnabled();
}
@Override
public void onMatch(RelOptRuleCall call) {
final DrillJoinRel join = (DrillJoinRel) call.rel(0);
final RelNode left = join.getLeft();
final RelNode right = join.getRight();
if (!checkPreconditions(join, left, right)) {
return;
}
boolean hashSingleKey = PrelUtil.getPlannerSettings(call.getPlanner()).isHashSingleKey();
try {
RelCollation collationLeft = getCollation(join.getLeftKeys());
RelCollation collationRight = getCollation(join.getRightKeys());
createDistBothPlan(call, join, PhysicalJoinType.MERGE_JOIN, left, right, collationLeft, collationRight, hashSingleKey);
if (checkBroadcastConditions(call.getPlanner(), join, left, right)) {
createBroadcastPlan(call, join, PhysicalJoinType.MERGE_JOIN, left, right, collationLeft, collationRight);