public RelNode createSemiJoin(RelNode left, RelNode right, RexNode condition) { final JoinInfo joinInfo = JoinInfo.of(left, right, condition); return SemiJoin.create(left, right, condition, joinInfo.leftKeys, joinInfo.rightKeys); } }
public RelNode createSemiJoin(RelNode left, RelNode right, RexNode condition) { final JoinInfo joinInfo = JoinInfo.of(left, right, condition); return SemiJoin.create(left, right, condition, joinInfo.leftKeys, joinInfo.rightKeys); } }
SemiJoin semiJoin = possibleDimensions.get(bestDimIdx); SemiJoin chosenSemiJoin = SemiJoin.create(factRel, chosenSemiJoins[bestDimIdx], semiJoin.getCondition(),
semiJoinCondition); return SemiJoin.create(factRel, dimRel, semiJoinCondition, ImmutableIntList.copyOf(truncatedLeftKeys), ImmutableIntList.copyOf(truncatedRightKeys));
SemiJoin semiJoin = possibleDimensions.get(bestDimIdx); SemiJoin chosenSemiJoin = SemiJoin.create(factRel, chosenSemiJoins[bestDimIdx], semiJoin.getCondition(),
semiJoinCondition); return SemiJoin.create(factRel, dimRel, semiJoinCondition, ImmutableIntList.copyOf(truncatedLeftKeys), ImmutableIntList.copyOf(truncatedRightKeys));
public void onMatch(RelOptRuleCall call) { SemiJoin semiJoin = call.rel(0); LogicalProject project = call.rel(1); // Convert the LHS semi-join keys to reference the child projection // expression; all projection expressions must be RexInputRefs, // otherwise, we wouldn't have created this semi-join. final List<Integer> newLeftKeys = new ArrayList<>(); final List<Integer> leftKeys = semiJoin.getLeftKeys(); final List<RexNode> projExprs = project.getProjects(); for (int leftKey : leftKeys) { RexInputRef inputRef = (RexInputRef) projExprs.get(leftKey); newLeftKeys.add(inputRef.getIndex()); } // convert the semijoin condition to reflect the LHS with the project // pulled up RexNode newCondition = adjustCondition(project, semiJoin); SemiJoin newSemiJoin = SemiJoin.create(project.getInput(), semiJoin.getRight(), newCondition, ImmutableIntList.copyOf(newLeftKeys), semiJoin.getRightKeys()); // Create the new projection. Note that the projection expressions // are the same as the original because they only reference the LHS // of the semijoin and the semijoin only projects out the LHS final RelBuilder relBuilder = call.builder(); relBuilder.push(newSemiJoin); relBuilder.project(projExprs, project.getRowType().getFieldNames()); call.transformTo(relBuilder.build()); }
public void onMatch(RelOptRuleCall call) { SemiJoin semiJoin = call.rel(0); LogicalProject project = call.rel(1); // Convert the LHS semi-join keys to reference the child projection // expression; all projection expressions must be RexInputRefs, // otherwise, we wouldn't have created this semi-join. final List<Integer> newLeftKeys = new ArrayList<>(); final List<Integer> leftKeys = semiJoin.getLeftKeys(); final List<RexNode> projExprs = project.getProjects(); for (int leftKey : leftKeys) { RexInputRef inputRef = (RexInputRef) projExprs.get(leftKey); newLeftKeys.add(inputRef.getIndex()); } // convert the semijoin condition to reflect the LHS with the project // pulled up RexNode newCondition = adjustCondition(project, semiJoin); SemiJoin newSemiJoin = SemiJoin.create(project.getInput(), semiJoin.getRight(), newCondition, ImmutableIntList.copyOf(newLeftKeys), semiJoin.getRightKeys()); // Create the new projection. Note that the projection expressions // are the same as the original because they only reference the LHS // of the semijoin and the semijoin only projects out the LHS final RelBuilder relBuilder = call.builder(); relBuilder.push(newSemiJoin); relBuilder.project(projExprs, project.getRowType().getFieldNames()); call.transformTo(relBuilder.build()); }
public void onMatch(RelOptRuleCall call) { SemiJoin semiJoin = call.rel(0); LogicalProject project = call.rel(1); // Convert the LHS semi-join keys to reference the child projection // expression; all projection expressions must be RexInputRefs, // otherwise, we wouldn't have created this semi-join. final List<Integer> newLeftKeys = new ArrayList<>(); final List<Integer> leftKeys = semiJoin.getLeftKeys(); final List<RexNode> projExprs = project.getProjects(); for (int leftKey : leftKeys) { RexInputRef inputRef = (RexInputRef) projExprs.get(leftKey); newLeftKeys.add(inputRef.getIndex()); } // convert the semijoin condition to reflect the LHS with the project // pulled up RexNode newCondition = adjustCondition(project, semiJoin); SemiJoin newSemiJoin = SemiJoin.create(project.getInput(), semiJoin.getRight(), newCondition, ImmutableIntList.copyOf(newLeftKeys), semiJoin.getRightKeys(), semiJoin.isAnti); // Create the new projection. Note that the projection expressions // are the same as the original because they only reference the LHS // of the semijoin and the semijoin only projects out the LHS final RelBuilder relBuilder = call.builder(); relBuilder.push(newSemiJoin); relBuilder.project(projExprs, project.getRowType().getFieldNames()); call.transformTo(relBuilder.build()); }
public void onMatch(RelOptRuleCall call) { SemiJoin semiJoin = call.rel(0); LogicalFilter filter = call.rel(1); RelNode newSemiJoin = SemiJoin.create(filter.getInput(), semiJoin.getRight(), semiJoin.getCondition(), semiJoin.getLeftKeys(), semiJoin.getRightKeys()); final RelFactories.FilterFactory factory = RelFactories.DEFAULT_FILTER_FACTORY; RelNode newFilter = factory.createFilter(newSemiJoin, filter.getCondition()); call.transformTo(newFilter); } }
public void onMatch(RelOptRuleCall call) { SemiJoin semiJoin = call.rel(0); LogicalFilter filter = call.rel(1); RelNode newSemiJoin = SemiJoin.create(filter.getInput(), semiJoin.getRight(), semiJoin.getCondition(), semiJoin.getLeftKeys(), semiJoin.getRightKeys()); final RelFactories.FilterFactory factory = RelFactories.DEFAULT_FILTER_FACTORY; RelNode newFilter = factory.createFilter(newSemiJoin, filter.getCondition()); call.transformTo(newFilter); } }
SemiJoin.create(leftSemiJoinOp, semiJoin.getRight(), newSemiJoinFilter,
SemiJoin.create(origJoinRel.getLeft(), origJoinRel.getRight(), origJoinRel.getCondition(),
SemiJoin.create(origJoinRel.getLeft(), origJoinRel.getRight(), origJoinRel.getCondition(),
SemiJoin.create(leftSemiJoinOp, semiJoin.getRight(), newSemiJoinFilter,
SemiJoin.create(leftSemiJoinOp, semiJoin.getRight(), newSemiJoinFilter,