@Override public SqlNode visit(SqlIdentifier id) { if (id.isSimple()) { return id; } SqlOperator operator = id.names.get(0).equals(alpha) ? SqlStdOperatorTable.PREV : SqlStdOperatorTable.LAST; return operator.createCall(SqlParserPos.ZERO, id, SqlLiteral.createExactNumeric("0", SqlParserPos.ZERO)); } }
/** Parses a unsigned numeric literal */ final public SqlNumericLiteral UnsignedNumericLiteral() throws ParseException { if (jj_2_321(2)) { jj_consume_token(UNSIGNED_INTEGER_LITERAL); {if (true) return SqlLiteral.createExactNumeric(token.image, getPos());} } else if (jj_2_322(2)) { jj_consume_token(DECIMAL_NUMERIC_LITERAL); {if (true) return SqlLiteral.createExactNumeric(token.image, getPos());} } else if (jj_2_323(2)) { jj_consume_token(APPROX_NUMERIC_LITERAL); {if (true) return SqlLiteral.createApproxNumeric(token.image, getPos());} } else { jj_consume_token(-1); throw new ParseException(); } throw new Error("Missing return statement in function"); }
if (jj_2_222(2)) { jj_consume_token(STAR); startNum = SqlLiteral.createExactNumeric("0", SqlParserPos.ZERO); endNum = SqlLiteral.createExactNumeric("-1", SqlParserPos.ZERO); } else if (jj_2_223(2)) { jj_consume_token(PLUS); startNum = SqlLiteral.createExactNumeric("1", SqlParserPos.ZERO); endNum = SqlLiteral.createExactNumeric("-1", SqlParserPos.ZERO); } else if (jj_2_224(2)) { jj_consume_token(HOOK); startNum = SqlLiteral.createExactNumeric("0", SqlParserPos.ZERO); endNum = SqlLiteral.createExactNumeric("1", SqlParserPos.ZERO); } else if (jj_2_225(2)) { jj_consume_token(LBRACE); if (jj_2_218(2)) { jj_consume_token(COMMA); endNum = SqlLiteral.createExactNumeric("-1", SqlParserPos.ZERO); if (jj_2_217(2)) { endNum = UnsignedNumericLiteral(); startNum = SqlLiteral.createExactNumeric("-1", SqlParserPos.ZERO); jj_consume_token(COMMA); endNum = UnsignedNumericLiteral();
private void doWriteFetchNext(SqlNode fetch, SqlNode offset) { if (offset == null && !configurer.allowNoOffset()) offset = SqlLiteral.createExactNumeric("0", SqlParserPos.ZERO); if (fetch != null && !configurer.allowNoOrderByWithFetch() && lastFrame != null && lastFrame.getFrameType() != FrameTypeEnum.ORDER_BY_LIST) { // MSSQL requires ORDER_BY list for FETCH clause, so must append one here. DUMMY_ORDER_BY_NODE.unparse(this, 0, 0); } if (offset != null) { this.newlineAndIndent(); final Frame offsetFrame = this.startList(FrameTypeEnum.OFFSET); this.keyword("OFFSET"); offset.unparse(this, -1, -1); this.keyword("ROWS"); this.endList(offsetFrame); } if (fetch != null) { if (!configurer.allowFetchNoRows() && fetch instanceof SqlNumericLiteral) if (((SqlNumericLiteral) fetch).toValue().equals("0")) fetch = SqlLiteral.createExactNumeric("1", SqlParserPos.ZERO); this.newlineAndIndent(); final Frame fetchFrame = this.startList(FrameTypeEnum.FETCH); this.keyword("FETCH"); this.keyword("NEXT"); fetch.unparse(this, -1, -1); this.keyword("ROWS"); this.keyword("ONLY"); this.endList(fetchFrame); } }
/** Parses a unsigned numeric literal */ final public SqlNumericLiteral UnsignedNumericLiteral() throws ParseException { if (jj_2_321(2)) { jj_consume_token(UNSIGNED_INTEGER_LITERAL); {if (true) return SqlLiteral.createExactNumeric(token.image, getPos());} } else if (jj_2_322(2)) { jj_consume_token(DECIMAL_NUMERIC_LITERAL); {if (true) return SqlLiteral.createExactNumeric(token.image, getPos());} } else if (jj_2_323(2)) { jj_consume_token(APPROX_NUMERIC_LITERAL); {if (true) return SqlLiteral.createApproxNumeric(token.image, getPos());} } else { jj_consume_token(-1); throw new ParseException(); } throw new Error("Missing return statement in function"); }
final public SqlCall MatchRecognizeNavigationPhysical() throws ParseException { final Span s; SqlCall func; SqlOperator funcOp; SqlNode arg0; SqlNode arg1 = SqlLiteral.createExactNumeric("1", SqlParserPos.ZERO); if (jj_2_575(2)) { jj_consume_token(PREV); funcOp = SqlStdOperatorTable.PREV; } else if (jj_2_576(2)) { jj_consume_token(NEXT); funcOp = SqlStdOperatorTable.NEXT; } else { jj_consume_token(-1); throw new ParseException(); } s = span(); jj_consume_token(LPAREN); arg0 = Expression(ExprContext.ACCEPT_SUB_QUERY); if (jj_2_577(2)) { jj_consume_token(COMMA); arg1 = NumericLiteral(); } else { ; } jj_consume_token(RPAREN); {if (true) return funcOp.createCall(s.end(this), arg0, arg1);} throw new Error("Missing return statement in function"); }
if (jj_2_222(2)) { jj_consume_token(STAR); startNum = SqlLiteral.createExactNumeric("0", SqlParserPos.ZERO); endNum = SqlLiteral.createExactNumeric("-1", SqlParserPos.ZERO); } else if (jj_2_223(2)) { jj_consume_token(PLUS); startNum = SqlLiteral.createExactNumeric("1", SqlParserPos.ZERO); endNum = SqlLiteral.createExactNumeric("-1", SqlParserPos.ZERO); } else if (jj_2_224(2)) { jj_consume_token(HOOK); startNum = SqlLiteral.createExactNumeric("0", SqlParserPos.ZERO); endNum = SqlLiteral.createExactNumeric("1", SqlParserPos.ZERO); } else if (jj_2_225(2)) { jj_consume_token(LBRACE); if (jj_2_218(2)) { jj_consume_token(COMMA); endNum = SqlLiteral.createExactNumeric("-1", SqlParserPos.ZERO); if (jj_2_217(2)) { endNum = UnsignedNumericLiteral(); startNum = SqlLiteral.createExactNumeric("-1", SqlParserPos.ZERO); jj_consume_token(COMMA); endNum = UnsignedNumericLiteral();
SqlNode amt = bs.getAmt() == 0 ? null : SqlLiteral.createExactNumeric( String.valueOf(bs.getAmt()), new SqlParserPos(2, 2)); RexNode amtLiteral = null;
if (stripAs(sel.e).equalsDeep(sqlNode, Litmus.IGNORE)) { orderList.set(i, SqlLiteral.createExactNumeric(Integer.toString(sel.i + 1), SqlParserPos.ZERO));
SqlNode amt = bs.getAmt() == 0 ? null : SqlLiteral.createExactNumeric( String.valueOf(bs.getAmt()), new SqlParserPos(2, 2)); RexNode amtLiteral = null;
final SqlOperator runningOp; SqlNode arg0; SqlNode arg1 = SqlLiteral.createExactNumeric("0", SqlParserPos.ZERO); if (jj_2_570(2)) { jj_consume_token(RUNNING);
final public SqlCall MatchRecognizeNavigationPhysical() throws ParseException { final Span s; SqlCall func; SqlOperator funcOp; SqlNode arg0; SqlNode arg1 = SqlLiteral.createExactNumeric("1", SqlParserPos.ZERO); if (jj_2_575(2)) { jj_consume_token(PREV); funcOp = SqlStdOperatorTable.PREV; } else if (jj_2_576(2)) { jj_consume_token(NEXT); funcOp = SqlStdOperatorTable.NEXT; } else { jj_consume_token(-1); throw new ParseException(); } s = span(); jj_consume_token(LPAREN); arg0 = Expression(ExprContext.ACCEPT_SUB_QUERY); if (jj_2_577(2)) { jj_consume_token(COMMA); arg1 = NumericLiteral(); } else { ; } jj_consume_token(RPAREN); {if (true) return funcOp.createCall(s.end(this), arg0, arg1);} throw new Error("Missing return statement in function"); }
final SqlOperator runningOp; SqlNode arg0; SqlNode arg1 = SqlLiteral.createExactNumeric("0", SqlParserPos.ZERO); if (jj_2_570(2)) { jj_consume_token(RUNNING);
/** Parses a unsigned numeric literal */ final public SqlNumericLiteral UnsignedNumericLiteral() throws ParseException { if (jj_2_326(2)) { jj_consume_token(UNSIGNED_INTEGER_LITERAL); {if ("" != null) return SqlLiteral.createExactNumeric(token.image, getPos());} } else if (jj_2_327(2)) { jj_consume_token(DECIMAL_NUMERIC_LITERAL); {if ("" != null) return SqlLiteral.createExactNumeric(token.image, getPos());} } else if (jj_2_328(2)) { jj_consume_token(APPROX_NUMERIC_LITERAL); {if ("" != null) return SqlLiteral.createApproxNumeric(token.image, getPos());} } else { jj_consume_token(-1); throw new ParseException(); } throw new Error("Missing return statement in function"); }
if (jj_2_224(2)) { jj_consume_token(STAR); startNum = SqlLiteral.createExactNumeric("0", SqlParserPos.ZERO); endNum = SqlLiteral.createExactNumeric("-1", SqlParserPos.ZERO); } else if (jj_2_225(2)) { jj_consume_token(PLUS); startNum = SqlLiteral.createExactNumeric("1", SqlParserPos.ZERO); endNum = SqlLiteral.createExactNumeric("-1", SqlParserPos.ZERO); } else if (jj_2_226(2)) { jj_consume_token(HOOK); startNum = SqlLiteral.createExactNumeric("0", SqlParserPos.ZERO); endNum = SqlLiteral.createExactNumeric("1", SqlParserPos.ZERO); } else if (jj_2_227(2)) { jj_consume_token(LBRACE); if (jj_2_220(2)) { jj_consume_token(COMMA); endNum = SqlLiteral.createExactNumeric("-1", SqlParserPos.ZERO); if (jj_2_219(2)) { endNum = UnsignedNumericLiteral(); startNum = SqlLiteral.createExactNumeric("-1", SqlParserPos.ZERO); jj_consume_token(COMMA); endNum = UnsignedNumericLiteral();
final public SqlCall MatchRecognizeNavigationPhysical() throws ParseException {final Span s; SqlCall func; SqlOperator funcOp; SqlNode arg0; SqlNode arg1 = SqlLiteral.createExactNumeric("1", SqlParserPos.ZERO); if (jj_2_580(2)) { jj_consume_token(PREV); funcOp = SqlStdOperatorTable.PREV; } else if (jj_2_581(2)) { jj_consume_token(NEXT); funcOp = SqlStdOperatorTable.NEXT; } else { jj_consume_token(-1); throw new ParseException(); } s = span(); jj_consume_token(LPAREN); arg0 = Expression(ExprContext.ACCEPT_SUB_QUERY); if (jj_2_582(2)) { jj_consume_token(COMMA); arg1 = NumericLiteral(); } else { ; } jj_consume_token(RPAREN); {if ("" != null) return funcOp.createCall(s.end(this), arg0, arg1);} throw new Error("Missing return statement in function"); }
@Override public SqlNode visit(SqlIdentifier id) { if (id.isSimple()) { return id; } SqlOperator operator = id.names.get(0).equals(alpha) ? SqlStdOperatorTable.PREV : SqlStdOperatorTable.LAST; return operator.createCall(SqlParserPos.ZERO, id, SqlLiteral.createExactNumeric("0", SqlParserPos.ZERO)); } }
@Override public SqlNode visit(SqlIdentifier id) { if (id.isSimple()) { return id; } SqlOperator operator = id.names.get(0).equals(alpha) ? SqlStdOperatorTable.PREV : SqlStdOperatorTable.LAST; return operator.createCall(SqlParserPos.ZERO, id, SqlLiteral.createExactNumeric("0", SqlParserPos.ZERO)); } }
final SqlOperator runningOp; SqlNode arg0; SqlNode arg1 = SqlLiteral.createExactNumeric("0", SqlParserPos.ZERO); if (jj_2_575(2)) { jj_consume_token(RUNNING);
public SqlNode getNode(SqlNode node){ SqlLiteral literal; if(isArray){ literal = SqlLiteral.createExactNumeric(value, parserPos); }else{ literal = SqlLiteral.createCharString(value, parserPos); } return new SqlBasicCall(SqlStdOperatorTable.ITEM, new SqlNode[]{ node, literal }, parserPos); }