public static JoinPredicateInfo constructJoinPredicateInfo(MultiJoin mj, RexNode predicate) { final List<RelDataTypeField> systemFieldList = ImmutableList.of(); return constructJoinPredicateInfo(mj.getInputs(), systemFieldList, predicate); }
public Double getRowCount(MultiJoin rel, RelMetadataQuery mq) { if (rel.getJoinFilter().isAlwaysTrue() && RexUtil.composeConjunction(rel.getCluster().getRexBuilder(), rel.getOuterJoinConditions(), false).isAlwaysTrue()) { double rowCount = 1; for (RelNode input : rel.getInputs()) { rowCount *= mq.getRowCount(input); } return rowCount; } else { double max = 1; for (RelNode input : rel.getInputs()) { max = Math.max(max, mq.getRowCount(input)); } return max; } }
public LoptMultiJoin(MultiJoin multiJoin) { this.multiJoin = multiJoin; joinFactors = ImmutableList.copyOf(multiJoin.getInputs()); nJoinFactors = joinFactors.size(); projFields = multiJoin.getProjFields();
public LoptMultiJoin(MultiJoin multiJoin) { this.multiJoin = multiJoin; joinFactors = ImmutableList.copyOf(multiJoin.getInputs()); nJoinFactors = joinFactors.size(); projFields = multiJoin.getProjFields();
public void onMatch(RelOptRuleCall call) { LogicalProject project = call.rel(0); MultiJoin multiJoin = call.rel(1); // if all inputs have their projFields set, then projection information // has already been pushed into each input boolean allSet = true; for (int i = 0; i < multiJoin.getInputs().size(); i++) { if (multiJoin.getProjFields().get(i) == null) { allSet = false; break; } } if (allSet) { return; } // create a new MultiJoin that reflects the columns in the projection // above the MultiJoin final RelBuilder relBuilder = call.builder(); MultiJoin newMultiJoin = RelOptUtil.projectMultiJoin(multiJoin, project); relBuilder.push(newMultiJoin) .project(project.getProjects(), project.getRowType().getFieldNames()); call.transformTo(relBuilder.build()); } }
public void onMatch(RelOptRuleCall call) { LogicalProject project = call.rel(0); MultiJoin multiJoin = call.rel(1); // if all inputs have their projFields set, then projection information // has already been pushed into each input boolean allSet = true; for (int i = 0; i < multiJoin.getInputs().size(); i++) { if (multiJoin.getProjFields().get(i) == null) { allSet = false; break; } } if (allSet) { return; } // create a new MultiJoin that reflects the columns in the projection // above the MultiJoin final RelBuilder relBuilder = call.builder(); MultiJoin newMultiJoin = RelOptUtil.projectMultiJoin(multiJoin, project); relBuilder.push(newMultiJoin) .project(project.getProjects(), project.getRowType().getFieldNames()); call.transformTo(relBuilder.build()); } }
final List<RelNode> originalInputs = multiJoin.getInputs(); final RexNode originalJoinFilter = multiJoin.getJoinFilter(); final List<RexNode> originalOuterJoinConditions = multiJoin.getOuterJoinConditions();
public void onMatch(RelOptRuleCall call) { LogicalFilter filter = call.rel(0); MultiJoin multiJoin = call.rel(1); MultiJoin newMultiJoin = new MultiJoin( multiJoin.getCluster(), multiJoin.getInputs(), multiJoin.getJoinFilter(), multiJoin.getRowType(), multiJoin.isFullOuterJoin(), multiJoin.getOuterJoinConditions(), multiJoin.getJoinTypes(), multiJoin.getProjFields(), multiJoin.getJoinFieldRefCountsMap(), filter.getCondition()); call.transformTo(newMultiJoin); } }
public void onMatch(RelOptRuleCall call) { LogicalFilter filter = call.rel(0); MultiJoin multiJoin = call.rel(1); MultiJoin newMultiJoin = new MultiJoin( multiJoin.getCluster(), multiJoin.getInputs(), multiJoin.getJoinFilter(), multiJoin.getRowType(), multiJoin.isFullOuterJoin(), multiJoin.getOuterJoinConditions(), multiJoin.getJoinTypes(), multiJoin.getProjFields(), multiJoin.getJoinFieldRefCountsMap(), filter.getCondition()); call.transformTo(newMultiJoin); } }