public BlockStatement compileToBlock(List<RexNode> nodes, RelDataType inputRowType) { final RexProgramBuilder programBuilder = new RexProgramBuilder(inputRowType, rexBuilder); for (RexNode node : nodes) { programBuilder.addProject(node, null); } return compileToBlock(programBuilder.getProgram()); }
public String compile(List<RexNode> nodes, RelDataType inputRowType, String className) { final RexProgramBuilder programBuilder = new RexProgramBuilder(inputRowType, rexBuilder); for (RexNode node : nodes) { programBuilder.addProject(node, null); } return compile(programBuilder.getProgram(), className); }
/** * Adds a projection based upon the <code>index</code>th expression at a * given position. * * @param at Position in project list to add expression * @param ordinal Index of expression to project * @param name Name of field in output row type; if null, a unique name * will be generated when the program is created * @return the ref created */ public RexLocalRef addProject(int at, int ordinal, final String name) { return addProject( at, localRefList.get(ordinal), name); }
/** * Adds a projection based upon the <code>index</code>th expression at a * given position. * * @param at Position in project list to add expression * @param ordinal Index of expression to project * @param name Name of field in output row type; if null, a unique name * will be generated when the program is created * @return the ref created */ public RexLocalRef addProject(int at, int ordinal, final String name) { return addProject( at, localRefList.get(ordinal), name); }
/** * Adds a project expression to the program. * * <p>The expression specified in terms of the input fields. If not, call * {@link #registerOutput(RexNode)} first. * * @param expr Expression to add * @param name Name of field in output row type; if null, a unique name will * be generated when the program is created * @return the ref created */ public RexLocalRef addProject(RexNode expr, String name) { final RexLocalRef ref = registerInput(expr); return addProject(ref.getIndex(), name); }
/** * Adds a project expression to the program. * * <p>The expression specified in terms of the input fields. If not, call * {@link #registerOutput(RexNode)} first. * * @param expr Expression to add * @param name Name of field in output row type; if null, a unique name will * be generated when the program is created * @return the ref created */ public RexLocalRef addProject(RexNode expr, String name) { final RexLocalRef ref = registerInput(expr); return addProject(ref.getIndex(), name); }
new RexProgramBuilder(inputRowType, rexBuilder); for (int i = 0; i < projectExprs.size(); i++) { programBuilder.addProject(projectExprs.get(i), fieldNames.get(i));
new RexProgramBuilder(inputRowType, rexBuilder); for (int i = 0; i < projectExprs.size(); i++) { programBuilder.addProject(projectExprs.get(i), fieldNames.get(i));
public String compile(List<RexNode> nodes, RelDataType inputRowType, String className) { final RexProgramBuilder programBuilder = new RexProgramBuilder(inputRowType, rexBuilder); for (RexNode node : nodes) { programBuilder.addProject(node, null); } return compile(programBuilder.getProgram(), className); }
public BlockStatement compileToBlock(List<RexNode> nodes, RelDataType inputRowType) { final RexProgramBuilder programBuilder = new RexProgramBuilder(inputRowType, rexBuilder); for (RexNode node : nodes) { programBuilder.addProject(node, null); } return compileToBlock(programBuilder.getProgram()); }
/** * Adds a project item for every input field. * * <p>You cannot call this method if there are other project items. */ public void addIdentity() { assert projectRefList.isEmpty(); for (RelDataTypeField field : inputRowType.getFieldList()) { addProject( new RexInputRef( field.getIndex(), field.getType()), field.getName()); } }
/** * Adds a project item for every input field. * * <p>You cannot call this method if there are other project items. */ public void addIdentity() { assert projectRefList.isEmpty(); for (RelDataTypeField field : inputRowType.getFieldList()) { addProject( new RexInputRef( field.getIndex(), field.getType()), field.getName()); } }
new RexProgramBuilder(rowType, rexBuilder); for (RexNode node : constExps) { programBuilder.addProject( node, "c" + programBuilder.getProjectList().size());
new RexProgramBuilder(rowType, rexBuilder); for (RexNode node : constExps) { programBuilder.addProject( node, "c" + programBuilder.getProjectList().size());
new RexProgramBuilder(inputRowType, rexBuilder); for (RexNode node : nodes) { programBuilder.addProject(node, null);
new RexProgramBuilder(inputRowType, rexBuilder); for (RexNode node : nodes) { programBuilder.addProject(node, null);
programBuilder.addProject(flattenedExp.left, flattenedExp.right);
programBuilder.addProject(flattenedExp.left, flattenedExp.right);
rexBuilder); for (Pair<RexNode, String> field : project.getNamedProjects()) { progBuilder.addProject(field.left, field.right);
rexBuilder); for (Pair<RexNode, String> field : project.getNamedProjects()) { progBuilder.addProject(field.left, field.right);