/** * Merges two programs together, and normalizes the result. * * @param topProgram Top program. Its expressions are in terms of the * outputs of the bottom program. * @param bottomProgram Bottom program. Its expressions are in terms of the * result fields of the relational expression's input * @param rexBuilder Rex builder * @return Merged program * @see #mergePrograms(RexProgram, RexProgram, RexBuilder, boolean) */ public static RexProgram mergePrograms( RexProgram topProgram, RexProgram bottomProgram, RexBuilder rexBuilder) { return mergePrograms(topProgram, bottomProgram, rexBuilder, true); }
/** * Merges two programs together, and normalizes the result. * * @param topProgram Top program. Its expressions are in terms of the * outputs of the bottom program. * @param bottomProgram Bottom program. Its expressions are in terms of the * result fields of the relational expression's input * @param rexBuilder Rex builder * @return Merged program * @see #mergePrograms(RexProgram, RexProgram, RexBuilder, boolean) */ public static RexProgram mergePrograms( RexProgram topProgram, RexProgram bottomProgram, RexBuilder rexBuilder) { return mergePrograms(topProgram, bottomProgram, rexBuilder, true); }
public void onMatch(RelOptRuleCall call) { final Filter topFilter = call.rel(0); final Filter bottomFilter = call.rel(1); // use RexPrograms to merge the two FilterRels into a single program // so we can convert the two LogicalFilter conditions to directly // reference the bottom LogicalFilter's child RexBuilder rexBuilder = topFilter.getCluster().getRexBuilder(); RexProgram bottomProgram = createProgram(bottomFilter); RexProgram topProgram = createProgram(topFilter); RexProgram mergedProgram = RexProgramBuilder.mergePrograms(topProgram, bottomProgram, rexBuilder); RexNode newCondition = mergedProgram.expandLocalRef(mergedProgram.getCondition()); final RelBuilder relBuilder = call.builder(); relBuilder.push(bottomFilter.getInput()).filter(newCondition); call.transformTo(relBuilder.build()); }
RexProgramBuilder.mergePrograms( topProgram, bottomProgram,
public void onMatch(RelOptRuleCall call) { final Filter topFilter = call.rel(0); final Filter bottomFilter = call.rel(1); // use RexPrograms to merge the two FilterRels into a single program // so we can convert the two LogicalFilter conditions to directly // reference the bottom LogicalFilter's child RexBuilder rexBuilder = topFilter.getCluster().getRexBuilder(); RexProgram bottomProgram = createProgram(bottomFilter); RexProgram topProgram = createProgram(topFilter); RexProgram mergedProgram = RexProgramBuilder.mergePrograms( topProgram, bottomProgram, rexBuilder); RexNode newCondition = mergedProgram.expandLocalRef( mergedProgram.getCondition()); final RelBuilder relBuilder = call.builder(); relBuilder.push(bottomFilter.getInput()) .filter(newCondition); call.transformTo(relBuilder.build()); }
RexProgramBuilder.mergePrograms( topCalc.getProgram(), bottomCalc.getProgram(),
public void onMatch(RelOptRuleCall call) { final Filter topFilter = call.rel(0); final Filter bottomFilter = call.rel(1); // use RexPrograms to merge the two FilterRels into a single program // so we can convert the two LogicalFilter conditions to directly // reference the bottom LogicalFilter's child RexBuilder rexBuilder = topFilter.getCluster().getRexBuilder(); RexProgram bottomProgram = createProgram(bottomFilter); RexProgram topProgram = createProgram(topFilter); RexProgram mergedProgram = RexProgramBuilder.mergePrograms( topProgram, bottomProgram, rexBuilder); RexNode newCondition = mergedProgram.expandLocalRef( mergedProgram.getCondition()); final RelBuilder relBuilder = call.builder(); relBuilder.push(bottomFilter.getInput()) .filter(newCondition); call.transformTo(relBuilder.build()); }
RexProgramBuilder.mergePrograms( topCalc.getProgram(), bottomCalc.getProgram(),
RexProgramBuilder.mergePrograms( topProgram, bottomProgram,
RexProgramBuilder.mergePrograms( topProgram, bottomProgram,
RexProgram topProgram = topProgramBuilder.getProgram(); RexProgram mergedProgram = RexProgramBuilder.mergePrograms( topProgram, bottomProgram,
RexProgram topProgram = topProgramBuilder.getProgram(); RexProgram mergedProgram = RexProgramBuilder.mergePrograms( topProgram, bottomProgram,
RexProgramBuilder.mergePrograms( topProgram, bottomProgram,
RexProgramBuilder.mergePrograms( topProgram, bottomProgram,
RexProgramBuilder.mergePrograms( topProgram, bottomProgram,
RexProgramBuilder.mergePrograms( topProgram, bottomProgram,
RexProgramBuilder.mergePrograms( topProgram, bottomProgram,