@Override public SqlNode visit(SqlIdentifier id) { if (op == null) { return id; } else { return op.createCall(SqlParserPos.ZERO, id, offset); } } }
@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)); } }
SqlOperator newOperator = innerKind == kind ? SqlStdOperatorTable.PLUS : SqlStdOperatorTable.MINUS; offset = newOperator.createCall(SqlParserPos.ZERO, offset, innerOffset); inner = call.getOperator().createCall(SqlParserPos.ZERO, innerOperands.get(0), offset); inner.accept(new NavigationExpander(call.getOperator(), offset)); if (op != null) { newInnerNode = op.createCall(SqlParserPos.ZERO, newInnerNode, this.offset); SqlNode newNode = node.accept(new NavigationExpander()); if (op != null) { newNode = op.createCall(SqlParserPos.ZERO, newNode, offset); return call.getOperator().createCall(SqlParserPos.ZERO, newOperands); } else { if (op == null) { return call; } else { return op.createCall(SqlParserPos.ZERO, call, offset);
/** * Parses a NEW UDT(...) expression. */ final public SqlNode NewSpecification() throws ParseException { final Span s; final SqlNode routineCall; jj_consume_token(NEW); s = span(); routineCall = NamedRoutineCall(SqlFunctionCategory.USER_DEFINED_CONSTRUCTOR, ExprContext.ACCEPT_SUB_QUERY); {if (true) return SqlStdOperatorTable.NEW.createCall(s.end(routineCall), routineCall);} throw new Error("Missing return statement in function"); }
/** * Parses a CALL statement. */ final public SqlNode SqlProcedureCall() throws ParseException { final Span s; SqlNode routineCall; jj_consume_token(CALL); s = span(); routineCall = NamedRoutineCall(SqlFunctionCategory.USER_DEFINED_PROCEDURE, ExprContext.ACCEPT_SUB_QUERY); {if (true) return SqlStdOperatorTable.PROCEDURE_CALL.createCall( s.end(routineCall), routineCall);} throw new Error("Missing return statement in function"); }
private SqlNode navigationInMeasure(SqlNode node, boolean allRows) { final Set<String> prefix = node.accept(new PatternValidator(true)); Util.discard(prefix); final List<SqlNode> ops = ((SqlCall) node).getOperandList(); final SqlOperator defaultOp = allRows ? SqlStdOperatorTable.RUNNING : SqlStdOperatorTable.FINAL; final SqlNode op0 = ops.get(0); if (!isRunningOrFinal(op0.getKind()) || !allRows && op0.getKind() == SqlKind.RUNNING) { SqlNode newNode = defaultOp.createCall(SqlParserPos.ZERO, op0); node = SqlStdOperatorTable.AS.createCall(SqlParserPos.ZERO, newNode, ops.get(1)); } node = new NavigationExpander().go(node); return node; }
/** * Parses a NEW UDT(...) expression. */ final public SqlNode NewSpecification() throws ParseException { final Span s; final SqlNode routineCall; jj_consume_token(NEW); s = span(); routineCall = NamedRoutineCall(SqlFunctionCategory.USER_DEFINED_CONSTRUCTOR, ExprContext.ACCEPT_SUB_QUERY); {if (true) return SqlStdOperatorTable.NEW.createCall(s.end(routineCall), routineCall);} throw new Error("Missing return statement in function"); }
/** * Parses a CALL statement. */ final public SqlNode SqlProcedureCall() throws ParseException { final Span s; SqlNode routineCall; jj_consume_token(CALL); s = span(); routineCall = NamedRoutineCall(SqlFunctionCategory.USER_DEFINED_PROCEDURE, ExprContext.ACCEPT_SUB_QUERY); {if (true) return SqlStdOperatorTable.PROCEDURE_CALL.createCall( s.end(routineCall), routineCall);} throw new Error("Missing return statement in function"); }
final public SqlCall MatchRecognizeCallWithModifier() throws ParseException { final Span s; final SqlOperator runningOp; final SqlNode func; if (jj_2_568(2)) { jj_consume_token(RUNNING); runningOp = SqlStdOperatorTable.RUNNING; } else if (jj_2_569(2)) { jj_consume_token(FINAL); runningOp = SqlStdOperatorTable.FINAL; } else { jj_consume_token(-1); throw new ParseException(); } s = span(); func = NamedFunctionCall(); {if (true) return runningOp.createCall(s.end(func), func);} throw new Error("Missing return statement in function"); }
final public SqlCall SequenceExpression() throws ParseException { final Span s; final SqlOperator f; final SqlNode sequenceRef; if (jj_2_305(2)) { jj_consume_token(NEXT); f = SqlStdOperatorTable.NEXT_VALUE; s = span(); } else if (jj_2_306(2)) { jj_consume_token(CURRENT); f = SqlStdOperatorTable.CURRENT_VALUE; s = span(); } else { jj_consume_token(-1); throw new ParseException(); } jj_consume_token(VALUE); jj_consume_token(FOR); sequenceRef = CompoundIdentifier(); {if (true) return f.createCall(s.end(sequenceRef), sequenceRef);} throw new Error("Missing return statement in function"); }
func = funcOp.createCall(s.end(this), arg0, arg1); if (runningOp != null) { {if (true) return runningOp.createCall(s.end(this), func);} } else { {if (true) return func;}
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"); }
? SqlStdOperatorTable.FLOOR : SqlStdOperatorTable.CEIL; function = op.createCall(s.end(this), args); if (jj_2_589(2)) { jj_consume_token(OVER);
final public SqlCall MatchRecognizeCallWithModifier() throws ParseException { final Span s; final SqlOperator runningOp; final SqlNode func; if (jj_2_568(2)) { jj_consume_token(RUNNING); runningOp = SqlStdOperatorTable.RUNNING; } else if (jj_2_569(2)) { jj_consume_token(FINAL); runningOp = SqlStdOperatorTable.FINAL; } else { jj_consume_token(-1); throw new ParseException(); } s = span(); func = NamedFunctionCall(); {if (true) return runningOp.createCall(s.end(func), func);} throw new Error("Missing return statement in function"); }
final public SqlCall SequenceExpression() throws ParseException { final Span s; final SqlOperator f; final SqlNode sequenceRef; if (jj_2_305(2)) { jj_consume_token(NEXT); f = SqlStdOperatorTable.NEXT_VALUE; s = span(); } else if (jj_2_306(2)) { jj_consume_token(CURRENT); f = SqlStdOperatorTable.CURRENT_VALUE; s = span(); } else { jj_consume_token(-1); throw new ParseException(); } jj_consume_token(VALUE); jj_consume_token(FOR); sequenceRef = CompoundIdentifier(); {if (true) return f.createCall(s.end(sequenceRef), sequenceRef);} throw new Error("Missing return statement in function"); }
func = funcOp.createCall(s.end(this), arg0, arg1); if (runningOp != null) { {if (true) return runningOp.createCall(s.end(this), func);} } else { {if (true) return func;}
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"); }
? SqlStdOperatorTable.FLOOR : SqlStdOperatorTable.CEIL; function = op.createCall(s.end(this), args); if (jj_2_589(2)) { jj_consume_token(OVER);
/** * Parses a NEW UDT(...) expression. */ final public SqlNode NewSpecification() throws ParseException {final Span s; final SqlNode routineCall; jj_consume_token(NEW); s = span(); routineCall = NamedRoutineCall(SqlFunctionCategory.USER_DEFINED_CONSTRUCTOR, ExprContext.ACCEPT_SUB_QUERY); {if ("" != null) return SqlStdOperatorTable.NEW.createCall(s.end(routineCall), routineCall);} throw new Error("Missing return statement in function"); }
/** * Parses a CALL statement. */ final public SqlNode SqlProcedureCall() throws ParseException {final Span s; SqlNode routineCall; jj_consume_token(CALL); s = span(); routineCall = NamedRoutineCall(SqlFunctionCategory.USER_DEFINED_PROCEDURE, ExprContext.ACCEPT_SUB_QUERY); {if ("" != null) return SqlStdOperatorTable.PROCEDURE_CALL.createCall( s.end(routineCall), routineCall);} throw new Error("Missing return statement in function"); }