@Override public EnumerableRel implementEnumerable(List<EnumerableRel> inputs) { if (getInput() instanceof OLAPFilterRel) { // merge project & filter OLAPFilterRel filter = (OLAPFilterRel) getInput(); RelNode inputOfFilter = inputs.get(0).getInput(0); RexProgram program = RexProgram.create(inputOfFilter.getRowType(), this.rewriteProjects, filter.getCondition(), this.rowType, getCluster().getRexBuilder()); return new EnumerableCalc(getCluster(), getCluster().traitSetOf(EnumerableConvention.INSTANCE), // inputOfFilter, program); } else { // keep project for table scan EnumerableRel input = sole(inputs); RexProgram program = RexProgram.create(input.getRowType(), this.rewriteProjects, null, this.rowType, getCluster().getRexBuilder()); return new EnumerableCalc(getCluster(), getCluster().traitSetOf(EnumerableConvention.INSTANCE), // input, program); } }
/** * 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<? extends RexNode> projectExprs, RexNode conditionExpr, RelDataType outputRowType, RexBuilder rexBuilder) { return create(inputRowType, projectExprs, conditionExpr, outputRowType.getFieldNames(), rexBuilder); }
/** * 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<? extends RexNode> projectExprs, RexNode conditionExpr, RelDataType outputRowType, RexBuilder rexBuilder) { return create(inputRowType, projectExprs, conditionExpr, outputRowType.getFieldNames(), rexBuilder); }
projects.add(rexBuilder.makeInputRef(enumerable, field)); RexProgram program = RexProgram.create(enumerable.getRowType(), projects, null, root.validatedRowType, rexBuilder); enumerable = EnumerableCalc.create(enumerable, program);
projects.add(rexBuilder.makeInputRef(enumerable, field)); RexProgram program = RexProgram.create(enumerable.getRowType(), projects, null, root.validatedRowType, rexBuilder); enumerable = EnumerableCalc.create(enumerable, program);
projects.add(rexBuilder.makeInputRef(enumerable, field)); RexProgram program = RexProgram.create(enumerable.getRowType(), projects, null, root.validatedRowType, rexBuilder); enumerable = EnumerableCalc.create(enumerable, program);
public void onMatch(RelOptRuleCall call) { final EnumerableProject project = call.rel(0); final RelNode input = project.getInput(); final RexProgram program = RexProgram.create(input.getRowType(), project.getProjects(), null, project.getRowType(), project.getCluster().getRexBuilder()); final EnumerableCalc calc = EnumerableCalc.create(input, program); call.transformTo(calc); } }
public void onMatch(RelOptRuleCall call) { final EnumerableProject project = call.rel(0); final RelNode input = project.getInput(); final RexProgram program = RexProgram.create(input.getRowType(), project.getProjects(), null, project.getRowType(), project.getCluster().getRexBuilder()); final EnumerableCalc calc = EnumerableCalc.create(input, program); call.transformTo(calc); } }
public void onMatch(RelOptRuleCall call) { final LogicalProject project = call.rel(0); final RelNode input = project.getInput(); final RexProgram program = RexProgram.create( input.getRowType(), project.getProjects(), null, project.getRowType(), project.getCluster().getRexBuilder()); final LogicalCalc calc = LogicalCalc.create(input, program); call.transformTo(calc); } }
public void onMatch(RelOptRuleCall call) { final LogicalProject project = call.rel(0); final RelNode input = project.getInput(); final RexProgram program = RexProgram.create( input.getRowType(), project.getProjects(), null, project.getRowType(), project.getCluster().getRexBuilder()); final LogicalCalc calc = LogicalCalc.create(input, program); call.transformTo(calc); } }
@Override public EnumerableRel implementEnumerable(List<EnumerableRel> inputs) { if (getInput() instanceof OLAPFilterRel) { // merge project & filter OLAPFilterRel filter = (OLAPFilterRel) getInput(); RelNode inputOfFilter = inputs.get(0).getInput(0); RexProgram program = RexProgram.create(inputOfFilter.getRowType(), this.rewriteProjects, filter.getCondition(), this.rowType, getCluster().getRexBuilder()); return new EnumerableCalc(getCluster(), getCluster().traitSetOf(EnumerableConvention.INSTANCE), // inputOfFilter, program); } else { // keep project for table scan EnumerableRel input = sole(inputs); RexProgram program = RexProgram.create(input.getRowType(), this.rewriteProjects, null, this.rowType, getCluster().getRexBuilder()); return new EnumerableCalc(getCluster(), getCluster().traitSetOf(EnumerableConvention.INSTANCE), // input, program); } }
final RelNode input = project.getInput(); final RexProgram program = RexProgram.create( input.getRowType(), project.getProjects(),
final RelNode input = project.getInput(); final RexProgram program = RexProgram.create( input.getRowType(), project.getProjects(),
RexProgram.create( joinChildrenRowType, Pair.left(projects),
RexProgram.create( joinChildrenRowType, Pair.left(projects),
RexProgram.create( calc.getRowType(), project.getProjects(),
RexProgram.create( calc.getRowType(), project.getProjects(),