public static double estimateFilteredRows(RelNode child, RexProgram program) { // convert the program's RexLocalRef condition to an expanded RexNode RexLocalRef programCondition = program.getCondition(); RexNode condition; if (programCondition == null) { condition = null; } else { condition = program.expandLocalRef(programCondition); } return estimateFilteredRows( child, condition); }
public static double estimateFilteredRows(RelNode child, RexProgram program) { // convert the program's RexLocalRef condition to an expanded RexNode RexLocalRef programCondition = program.getCondition(); RexNode condition; if (programCondition == null) { condition = null; } else { condition = program.expandLocalRef(programCondition); } return estimateFilteredRows( child, condition); }
List<RexLocalRef> projList = mergedProgram.getProjectList(); for (int i = 0; i < nProjExprs; i++) { newProjExprs.add(mergedProgram.expandLocalRef(projList.get(i)));
List<RexLocalRef> projList = mergedProgram.getProjectList(); for (int i = 0; i < nProjExprs; i++) { newProjExprs.add(mergedProgram.expandLocalRef(projList.get(i)));
public void onMatch(RelOptRuleCall call) { FilterRel topFilter = call.rel(0); FilterRel bottomFilter = call.rel(1); // use RexPrograms to merge the two FilterRels into a single program // so we can convert the two FilterRel conditions to directly // reference the bottom FilterRel'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()); FilterRel newFilterRel = new FilterRel( topFilter.getCluster(), bottomFilter.getChild(), newCondition); call.transformTo(newFilterRel); }
public void onMatch(RelOptRuleCall call) { FilterRel topFilter = call.rel(0); FilterRel bottomFilter = call.rel(1); // use RexPrograms to merge the two FilterRels into a single program // so we can convert the two FilterRel conditions to directly // reference the bottom FilterRel'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()); FilterRel newFilterRel = new FilterRel( topFilter.getCluster(), bottomFilter.getChild(), newCondition); call.transformTo(newFilterRel); }
mergedProgram.expandLocalRef( mergedProgram.getCondition()); JoinRel newJoinRel = int [] adjustments = new int[nJoinFields]; for (int i = 0; i < nProjExprs; i++) { RexNode newExpr = mergedProgram.expandLocalRef(projList.get(i)); if (joinType != JoinRelType.INNER) { newExpr =
mergedProgram.expandLocalRef( mergedProgram.getCondition()); JoinRelBase newJoinRel = int[] adjustments = new int[nJoinFields]; for (int i = 0; i < nProjExprs; i++) { RexNode newExpr = mergedProgram.expandLocalRef(projList.get(i)); if (joinType != JoinRelType.INNER) { newExpr =
rexBuilder); return mergedProgram.expandLocalRef( mergedProgram.getCondition());
rexBuilder); return mergedProgram.expandLocalRef( mergedProgram.getCondition());
rexBuilder); return mergedProgram.expandLocalRef( mergedProgram.getCondition());
rexBuilder); return mergedProgram.expandLocalRef( mergedProgram.getCondition());