final RelNode swapped = JoinCommuteRule.swap(join,true); if (swapped == null) { return;
final RelNode swapped = JoinCommuteRule.swap(join,true); if (swapped == null) { return;
RelNode swapped = JoinCommuteRule.swap(join, true); assert swapped != null;
RelNode swapped = JoinCommuteRule.swap(join, true); assert swapped != null;
@Deprecated // to be removed before 2.0 public static RelNode swap(Join join) { return swap(join, false, RelFactories.LOGICAL_BUILDER.create(join.getCluster(), null)); }
@Deprecated // to be removed before 2.0 public static RelNode swap(Join join, boolean swapOuterJoins) { return swap(join, swapOuterJoins, RelFactories.LOGICAL_BUILDER.create(join.getCluster(), null)); }
@Deprecated // to be removed before 2.0 public static RelNode swap(Join join) { return swap(join, false, RelFactories.LOGICAL_BUILDER.create(join.getCluster(), null)); }
@Deprecated // to be removed before 2.0 public static RelNode swap(Join join, boolean swapOuterJoins) { return swap(join, swapOuterJoins, RelFactories.LOGICAL_BUILDER.create(join.getCluster(), null)); }
public void onMatch(final RelOptRuleCall call) { Join join = call.rel(0); if (!join.getSystemFieldList().isEmpty()) { // FIXME Enable this rule for joins with system fields return; } final RelNode swapped = swap(join, this.swapOuter, call.builder()); if (swapped == null) { return; } // The result is either a Project or, if the project is trivial, a // raw Join. final Join newJoin = swapped instanceof Join ? (Join) swapped : (Join) swapped.getInput(0); call.transformTo(swapped); // We have converted join='a join b' into swapped='select // a0,a1,a2,b0,b1 from b join a'. Now register that project='select // b0,b1,a0,a1,a2 from (select a0,a1,a2,b0,b1 from b join a)' is the // same as 'b join a'. If we didn't do this, the swap join rule // would fire on the new join, ad infinitum. final RelBuilder relBuilder = call.builder(); final List<RexNode> exps = RelOptUtil.createSwappedJoinExprs(newJoin, join, false); relBuilder.push(swapped) .project(exps, newJoin.getRowType().getFieldNames()); call.getPlanner().ensureRegistered(relBuilder.build(), newJoin); }
public void onMatch(final RelOptRuleCall call) { Join join = call.rel(0); if (!join.getSystemFieldList().isEmpty()) { // FIXME Enable this rule for joins with system fields return; } final RelNode swapped = swap(join, this.swapOuter, call.builder()); if (swapped == null) { return; } // The result is either a Project or, if the project is trivial, a // raw Join. final Join newJoin = swapped instanceof Join ? (Join) swapped : (Join) swapped.getInput(0); call.transformTo(swapped); // We have converted join='a join b' into swapped='select // a0,a1,a2,b0,b1 from b join a'. Now register that project='select // b0,b1,a0,a1,a2 from (select a0,a1,a2,b0,b1 from b join a)' is the // same as 'b join a'. If we didn't do this, the swap join rule // would fire on the new join, ad infinitum. final RelBuilder relBuilder = call.builder(); final List<RexNode> exps = RelOptUtil.createSwappedJoinExprs(newJoin, join, false); relBuilder.push(swapped) .project(exps, newJoin.getRowType().getFieldNames()); call.getPlanner().ensureRegistered(relBuilder.build(), newJoin); }
final RelNode swapped = JoinCommuteRule.swap(join,true); if (swapped == null) { return;