/** * List of compound identifiers in parentheses. The position extends from the * open parenthesis to the close parenthesis. */ final public Pair<SqlNodeList, SqlNodeList> ParenthesizedCompoundIdentifierList() throws ParseException { final Span s; final List<SqlNode> list = new ArrayList<SqlNode>(); final List<SqlNode> extendList = new ArrayList<SqlNode>(); jj_consume_token(LPAREN); s = span(); CompoundIdentifierTypeCommaList(list, extendList); jj_consume_token(RPAREN); {if (true) return Pair.of(new SqlNodeList(list, s.end(this)), new SqlNodeList(extendList, s.end(this)));} throw new Error("Missing return statement in function"); }
final public SqlNodeList MeasureColumnCommaList(Span s) throws ParseException { SqlNode e; final List<SqlNode> eList = new ArrayList<SqlNode>(); e = MeasureColumn(); eList.add(e); label_15: while (true) { if (jj_2_214(2)) { ; } else { break label_15; } jj_consume_token(COMMA); e = MeasureColumn(); eList.add(e); } {if (true) return new SqlNodeList(eList, s.addAll(eList).pos());} throw new Error("Missing return statement in function"); }
final public SqlNodeList PatternDefinitionCommaList(Span s) throws ParseException { SqlNode e; final List<SqlNode> eList = new ArrayList<SqlNode>(); e = PatternDefinition(); eList.add(e); label_20: while (true) { if (jj_2_234(2)) { ; } else { break label_20; } jj_consume_token(COMMA); e = PatternDefinition(); eList.add(e); } {if (true) return new SqlNodeList(eList, s.addAll(eList).pos());} throw new Error("Missing return statement in function"); }
final public SqlNodeList SubsetDefinitionCommaList(Span s) throws ParseException { SqlNode e; final List<SqlNode> eList = new ArrayList<SqlNode>(); e = SubsetDefinition(); eList.add(e); label_19: while (true) { if (jj_2_233(2)) { ; } else { break label_19; } jj_consume_token(COMMA); e = SubsetDefinition(); eList.add(e); } {if (true) return new SqlNodeList(eList, s.addAll(eList).pos());} throw new Error("Missing return statement in function"); }
/** * List of simple identifiers in parentheses. The position extends from the * open parenthesis to the close parenthesis. */ final public SqlNodeList ParenthesizedSimpleIdentifierList() throws ParseException { final Span s; final List<SqlNode> list = new ArrayList<SqlNode>(); jj_consume_token(LPAREN); s = span(); SimpleIdentifierCommaList(list); jj_consume_token(RPAREN); {if (true) return new SqlNodeList(list, s.end(this));} throw new Error("Missing return statement in function"); }
/** * Parses the optional GROUP BY clause for SELECT. */ final public SqlNodeList GroupByOpt() throws ParseException { List<SqlNode> list = Lists.newArrayList(); final Span s; if (jj_2_162(2)) { jj_consume_token(GROUP); s = span(); jj_consume_token(BY); list = GroupingElementList(); {if (true) return new SqlNodeList(list, s.addAll(list).pos());} } else { {if (true) return null;} } throw new Error("Missing return statement in function"); }
public SqlNodeList expandStar( SqlNodeList selectList, SqlSelect select, boolean includeSystemVars) { final List<SqlNode> list = new ArrayList<>(); final List<Map.Entry<String, RelDataType>> types = new ArrayList<>(); for (int i = 0; i < selectList.size(); i++) { final SqlNode selectItem = selectList.get(i); final RelDataType originalType = getValidatedNodeTypeIfKnown(selectItem); expandSelectItem( selectItem, select, Util.first(originalType, unknownType), list, catalogReader.nameMatcher().createSet(), types, includeSystemVars); } getRawSelectScope(select).setExpandedSelectList(list); return new SqlNodeList(list, SqlParserPos.ZERO); }
/** * List of compound identifiers in parentheses. The position extends from the * open parenthesis to the close parenthesis. */ final public Pair<SqlNodeList, SqlNodeList> ParenthesizedCompoundIdentifierList() throws ParseException { final Span s; final List<SqlNode> list = new ArrayList<SqlNode>(); final List<SqlNode> extendList = new ArrayList<SqlNode>(); jj_consume_token(LPAREN); s = span(); CompoundIdentifierTypeCommaList(list, extendList); jj_consume_token(RPAREN); {if (true) return Pair.of(new SqlNodeList(list, s.end(this)), new SqlNodeList(extendList, s.end(this)));} throw new Error("Missing return statement in function"); }
final public SqlNodeList ExtendList() throws ParseException { final Span s; List<SqlNode> list = Lists.newArrayList(); jj_consume_token(LPAREN); s = span(); ColumnType(list); label_9: while (true) { if (jj_2_151(2)) { ; } else { break label_9; } jj_consume_token(COMMA); ColumnType(list); } jj_consume_token(RPAREN); {if (true) return new SqlNodeList(list, s.end(this));} throw new Error("Missing return statement in function"); }
final public SqlNodeList ColumnDefinitionList() throws ParseException { SqlParserPos pos; List<ColumnDefinition> list = Lists.newArrayList(); jj_consume_token(LPAREN); pos = getPos(); ColumnDef(list); label_3: while (true) { if (jj_2_45(2)) { ; } else { break label_3; } jj_consume_token(COMMA); ColumnDef(list); } jj_consume_token(RPAREN); {if (true) return new SqlNodeList(list, pos.plus(getPos()));} throw new Error("Missing return statement in function"); }
final public SqlNodeList PatternDefinitionCommaList(Span s) throws ParseException { SqlNode e; final List<SqlNode> eList = new ArrayList<SqlNode>(); e = PatternDefinition(); eList.add(e); label_20: while (true) { if (jj_2_234(2)) { ; } else { break label_20; } jj_consume_token(COMMA); e = PatternDefinition(); eList.add(e); } {if (true) return new SqlNodeList(eList, s.addAll(eList).pos());} throw new Error("Missing return statement in function"); }
/** * List of simple identifiers in parentheses. The position extends from the * open parenthesis to the close parenthesis. */ final public SqlNodeList ParenthesizedSimpleIdentifierList() throws ParseException { final Span s; final List<SqlNode> list = new ArrayList<SqlNode>(); jj_consume_token(LPAREN); s = span(); SimpleIdentifierCommaList(list); jj_consume_token(RPAREN); {if (true) return new SqlNodeList(list, s.end(this));} throw new Error("Missing return statement in function"); }
final public SqlNodeList MeasureColumnCommaList(Span s) throws ParseException { SqlNode e; final List<SqlNode> eList = new ArrayList<SqlNode>(); e = MeasureColumn(); eList.add(e); label_15: while (true) { if (jj_2_214(2)) { ; } else { break label_15; } jj_consume_token(COMMA); e = MeasureColumn(); eList.add(e); } {if (true) return new SqlNodeList(eList, s.addAll(eList).pos());} throw new Error("Missing return statement in function"); }
final public SqlNodeList SubsetDefinitionCommaList(Span s) throws ParseException { SqlNode e; final List<SqlNode> eList = new ArrayList<SqlNode>(); e = SubsetDefinition(); eList.add(e); label_19: while (true) { if (jj_2_233(2)) { ; } else { break label_19; } jj_consume_token(COMMA); e = SubsetDefinition(); eList.add(e); } {if (true) return new SqlNodeList(eList, s.addAll(eList).pos());} throw new Error("Missing return statement in function"); }
public Result translate(Project e) { // This variant is for the top project as we want to keep // the column aliases instead of producing STAR Result x = visitChild(0, e.getInput()); parseCorrelTable(e, x); final Builder builder = x.builder(e, Clause.SELECT); final List<SqlNode> selectList = new ArrayList<>(); for (RexNode ref : e.getChildExps()) { SqlNode sqlExpr = builder.context.toSql(null, ref); addSelect(selectList, sqlExpr, e.getRowType()); } builder.setSelect(new SqlNodeList(selectList, POS)); return builder.result(); }
final public SqlNodeList WithList() throws ParseException { SqlWithItem withItem; SqlParserPos pos; SqlNodeList list; jj_consume_token(WITH); list = new SqlNodeList(getPos()); withItem = WithItem(); list.add(withItem); label_22: while (true) { if (jj_2_237(2)) { ; } else { break label_22; } jj_consume_token(COMMA); withItem = WithItem(); list.add(withItem); } {if (true) return list;} throw new Error("Missing return statement in function"); }
/** * Creates the SELECT statement that putatively feeds rows into a DELETE * statement to be deleted. * * @param call Call to the DELETE operator * @return select statement */ protected SqlSelect createSourceSelectForDelete(SqlDelete call) { final SqlNodeList selectList = new SqlNodeList(SqlParserPos.ZERO); selectList.add(SqlIdentifier.star(SqlParserPos.ZERO)); SqlNode sourceTable = call.getTargetTable(); if (call.getAlias() != null) { sourceTable = SqlValidatorUtil.addAlias( sourceTable, call.getAlias().getSimple()); } return new SqlSelect(SqlParserPos.ZERO, null, selectList, sourceTable, call.getCondition(), null, null, null, null, null, null); }
/** * Parses the optional GROUP BY clause for SELECT. */ final public SqlNodeList GroupByOpt() throws ParseException { List<SqlNode> list = Lists.newArrayList(); final Span s; if (jj_2_162(2)) { jj_consume_token(GROUP); s = span(); jj_consume_token(BY); list = GroupingElementList(); {if (true) return new SqlNodeList(list, s.addAll(list).pos());} } else { {if (true) return null;} } throw new Error("Missing return statement in function"); }
final public SqlNodeList ExtendList() throws ParseException { final Span s; List<SqlNode> list = Lists.newArrayList(); jj_consume_token(LPAREN); s = span(); ColumnType(list); label_9: while (true) { if (jj_2_151(2)) { ; } else { break label_9; } jj_consume_token(COMMA); ColumnType(list); } jj_consume_token(RPAREN); {if (true) return new SqlNodeList(list, s.end(this));} throw new Error("Missing return statement in function"); }
final public SqlNodeList ColumnDefinitionList() throws ParseException { SqlParserPos pos; List<ColumnDefinition> list = Lists.newArrayList(); jj_consume_token(LPAREN); pos = getPos(); ColumnDef(list); label_3: while (true) { if (jj_2_45(2)) { ; } else { break label_3; } jj_consume_token(COMMA); ColumnDef(list); } jj_consume_token(RPAREN); {if (true) return new SqlNodeList(list, pos.plus(getPos()));} throw new Error("Missing return statement in function"); }