final RelNode newJoin = rel.copy(rel.getTraitSet(), RexUtil.composeConjunction( relBuilder.getRexBuilder(), conjuncts, false), newLeftInput, newRightInput, rel.getJoinType(), rel.isSemiJoinDone());
final RelNode newJoin = rel.copy(rel.getTraitSet(), RexUtil.composeConjunction( relBuilder.getRexBuilder(), conjuncts, false), newLeftInput, newRightInput, rel.getJoinType(), rel.isSemiJoinDone());
} else if (call.rel(0) instanceof Join) { Join join = call.rel(0); newOp = join.copy(join.getTraitSet(), join.getCondition(), newInputs.get(0), newInputs.get(1), join.getJoinType(), join.isSemiJoinDone());
join = join.copy(join.getTraitSet(), cond, join.getLeft(), join.getRight(), JoinRelType.INNER, false);
@Override public void onMatch(RelOptRuleCall call) { final Join join = call.rel(0); final RexBuilder rexBuilder = join.getCluster().getRexBuilder(); final RexNode condition = RexUtil.pullFactors(rexBuilder, join.getCondition()); RexNode newCondition = analyzeRexNode(rexBuilder, condition); // If we could not transform anything, we bail out if (newCondition.toString().equals(condition.toString())) { return; } RelNode newNode = join.copy(join.getTraitSet(), newCondition, join.getLeft(), join.getRight(), join.getJoinType(), join.isSemiJoinDone()); call.transformTo(newNode); } }
join = join.copy(join.getTraitSet(), join.getCluster().getRexBuilder().makeLiteral(true), join.getLeft(), join.getRight(), JoinRelType.INNER, false);
} else if (call.rel(0) instanceof Join) { Join join = call.rel(0); newOp = join.copy(join.getTraitSet(), join.getCondition(), newInputs.get(0), newInputs.get(1), join.getJoinType(), join.isSemiJoinDone());
join.getTraitSet(), newJoinFilter, leftProjRel,
Join newJoin = join.copy(join.getTraitSet(), join.getCondition(), lChild, rChild, join.getJoinType(), join.isSemiJoinDone()); call.getPlanner().onCopy(join, newJoin);
Join newJoin = join.copy(join.getTraitSet(), join.getCondition(), lChild, rChild, join.getJoinType(), join.isSemiJoinDone()); call.getPlanner().onCopy(join, newJoin);
RelNode newRel = join.copy(join.getTraitSet(), join.getCondition(), lChild, rChild, join.getJoinType(), join.isSemiJoinDone()); call.getPlanner().onCopy(join, newRel);
RelNode newRel = join.copy(join.getTraitSet(), join.getCondition(), lChild, rChild, join.getJoinType(), join.isSemiJoinDone()); call.getPlanner().onCopy(join, newRel);
return new JdbcJoin( join.getCluster(), join.getTraitSet().replace(out), newInputs.get(0), newInputs.get(1),
return new JdbcJoin( join.getCluster(), join.getTraitSet().replace(out), newInputs.get(0), newInputs.get(1),
RelNode newRel = join.copy(join.getTraitSet(), join.getCondition(), lChild, rChild, join.getJoinType(), join.isSemiJoinDone()); call.getPlanner().onCopy(join, newRel);
RelNode newRel = join.copy(join.getTraitSet(), join.getCondition(), lChild, rChild, join.getJoinType(), join.isSemiJoinDone()); call.getPlanner().onCopy(join, newRel);
@Override public void onMatch(RelOptRuleCall call) { Join join = call.rel(0); RelOptPredicateList preds = RelMetadataQuery.getPulledUpPredicates(join); RexBuilder rB = join.getCluster().getRexBuilder(); RelNode lChild = call.rel(1); RelNode rChild = call.rel(2); List<RexNode> leftPreds = getValidPreds(preds.leftInferredPredicates, lChild.getRowType().getFieldList()); List<RexNode> rightPreds = getValidPreds(preds.rightInferredPredicates, rChild.getRowType().getFieldList()); if (leftPreds.isEmpty() && rightPreds.isEmpty()) { return; } if (leftPreds.size() > 0) { RelNode curr = lChild; lChild = filterFactory.createFilter(lChild, RexUtil.composeConjunction(rB, leftPreds, false)); call.getPlanner().onCopy(curr, lChild); } if (rightPreds.size() > 0) { RelNode curr = rChild; rChild = filterFactory.createFilter(rChild, RexUtil.composeConjunction(rB, rightPreds, false)); call.getPlanner().onCopy(curr, rChild); } RelNode newRel = join.copy(join.getTraitSet(), join.getCondition(), lChild, rChild, join.getJoinType(), join.isSemiJoinDone()); call.getPlanner().onCopy(join, newRel); call.transformTo(newRel); }
join.getTraitSet(), builder.literal(true), join.getLeft(),
join.getTraitSet(), expList.get(0), join.getLeft(),
join.getTraitSet(), builder.literal(true), join.getLeft(),