/** * Creates a program. * * <p>The expressions must be valid: they must not contain common expressions, * forward references, or non-trivial aggregates.</p> * * @param inputRowType Input row type * @param exprs Common expressions * @param projects Projection expressions * @param condition Condition expression. If null, calculator does not * filter rows * @param outputRowType Description of the row produced by the program */ public RexProgram( RelDataType inputRowType, List<? extends RexNode> exprs, List<RexLocalRef> projects, RexLocalRef condition, RelDataType outputRowType) { this.inputRowType = inputRowType; this.exprs = ImmutableList.copyOf(exprs); this.projects = ImmutableList.copyOf(projects); this.condition = condition; this.outputRowType = outputRowType; assert isValid(true); }
/** * Creates a program. * * @param inputRowType Input row type * @param exprs Common expressions * @param projects Projection expressions * @param condition Condition expression. If null, calculator does not * filter rows * @param outputRowType Description of the row produced by the program * * @pre !containCommonExprs(exprs) * @pre !containForwardRefs(exprs) * @pre !containNonTrivialAggs(exprs) */ public RexProgram( RelDataType inputRowType, List<? extends RexNode> exprs, List<RexLocalRef> projects, RexLocalRef condition, RelDataType outputRowType) { this.inputRowType = inputRowType; this.exprs = ImmutableList.copyOf(exprs); this.projects = ImmutableList.copyOf(projects); this.condition = condition; this.outputRowType = outputRowType; assert isValid(true); }
boolean normalize) assert program.isValid(true); final RelDataType inputRowType = program.getInputRowType(); final List<RexLocalRef> projectRefs = program.getProjectList();
RexBuilder rexBuilder, boolean normalize) { assert program.isValid(true); final RelDataType inputRowType = program.getInputRowType(); final List<RexLocalRef> projectRefs = program.getProjectList();
return false; if (!program.isValid(fail)) { return false;
if (!program.isValid(fail)) { return false;
assert program.isValid(true); final List<RexNode> exprList = program.getExprList(); final RexNode[] exprs = exprList.toArray(new RexNode[exprList.size()]);
assert program.isValid(true); final List<RexNode> exprList = program.getExprList(); final RexNode [] exprs = exprList.toArray(new RexNode[exprList.size()]);