/** * Creates a program which calculates projections and filters rows based * upon a condition. Does not attempt to eliminate common sub-expressions. * * @param projectExprs Project expressions * @param conditionExpr Condition on which to filter rows, or null if rows * are not to be filtered * @param outputRowType Output row type * @param rexBuilder Builder of rex expressions * @return A program */ public static RexProgram create( RelDataType inputRowType, List<RexNode> projectExprs, RexNode conditionExpr, RelDataType outputRowType, RexBuilder rexBuilder) { return create( inputRowType, projectExprs, conditionExpr, outputRowType.getFieldNames(), rexBuilder); }
public Branch visitChild( Stack stack ) { RexProgram program = RexProgram.create( getChild().getRowType(), exps, null, getRowType(), getCluster().getRexBuilder() ); return CalcProjectUtil.resolveBranch( stack, this, program ); } }
public void onMatch(RelOptRuleCall call) { final ProjectRel project = call.rel(0); final RelNode child = project.getChild(); final RelDataType rowType = project.getRowType(); final RexProgram program = RexProgram.create( child.getRowType(), project.getProjects(), null, project.getRowType(), project.getCluster().getRexBuilder()); final CalcRel calc = new CalcRel( project.getCluster(), project.getTraitSet(), child, rowType, program, Collections.<RelCollation>emptyList()); call.transformTo(calc); } }
public void onMatch(RelOptRuleCall call) { final EnumerableProjectRel project = call.rel(0); final RelNode child = project.getChild(); final RelDataType rowType = project.getRowType(); final RexProgram program = RexProgram.create(child.getRowType(), project.getProjects(), null, project.getRowType(), project.getCluster().getRexBuilder()); final EnumerableCalcRel calc = new EnumerableCalcRel( project.getCluster(), project.getTraitSet(), child, rowType, program, ImmutableList.<RelCollation>of()); call.transformTo(calc); } }
public void onMatch(RelOptRuleCall call) { final ProjectRel project = call.rel(0); final RelNode child = project.getChild(); final RelDataType rowType = project.getRowType(); final RexProgram program = RexProgram.create( child.getRowType(), project.getProjects(), null, project.getRowType(), project.getCluster().getRexBuilder()); final CalcRel calc = new CalcRel( project.getCluster(), project.getTraitSet(), child, rowType, program, ImmutableList.<RelCollation>of()); call.transformTo(calc); } }
final RelOptCluster cluster = child.getCluster(); final RexProgram program = RexProgram.create( child.getRowType(), exprs, null, fieldNames, cluster.getRexBuilder());
RexProgram.create(child.getChild().getRowType(), child.getProjects(), null, child.getRowType(), child.getCluster().getRexBuilder());
final RelDataType rowType = project.getRowType(); final RexProgram program = RexProgram.create( child.getRowType(), project.getProjects(),
RexProgram.create( joinChildrenRowType, Pair.left(projects),
RexProgram.create( projRel.getChild().getRowType(), projRel.getProjects(),
RexProgram.create( projRel.getChild().getRowType(), projRel.getProjects(),
RexProgram.create( joinChildrenRowType, Pair.left(projects),
RexProgram.create( calc.getRowType(), project.getProjects(),
RexProgram.create( calc.getRowType(), project.getProjects(),