org.apache.calcite.sql.parser.ddl.SqlDdlParserImpl Maven / Gradle / Ivy
/* Generated By:JavaCC: Do not edit this line. SqlDdlParserImpl.java */
package org.apache.calcite.sql.parser.ddl;
import org.apache.calcite.schema.ColumnStrategy;
import org.apache.calcite.sql.SqlCreate;
import org.apache.calcite.sql.SqlDrop;
import org.apache.calcite.sql.ddl.SqlDdlNodes;
import java.util.Map;
import java.util.HashMap;
import org.apache.calcite.avatica.util.Casing;
import org.apache.calcite.avatica.util.DateTimeUtils;
import org.apache.calcite.avatica.util.TimeUnit;
import org.apache.calcite.rel.type.RelDataType;
import org.apache.calcite.runtime.CalciteContextException;
import org.apache.calcite.sql.JoinConditionType;
import org.apache.calcite.sql.JoinType;
import org.apache.calcite.sql.SqlAlter;
import org.apache.calcite.sql.SqlBasicTypeNameSpec;
import org.apache.calcite.sql.SqlBinaryOperator;
import org.apache.calcite.sql.SqlCall;
import org.apache.calcite.sql.SqlCharStringLiteral;
import org.apache.calcite.sql.SqlCollation;
import org.apache.calcite.sql.SqlCollectionTypeNameSpec;
import org.apache.calcite.sql.SqlDataTypeSpec;
import org.apache.calcite.sql.SqlDateLiteral;
import org.apache.calcite.sql.SqlDelete;
import org.apache.calcite.sql.SqlDescribeSchema;
import org.apache.calcite.sql.SqlDescribeTable;
import org.apache.calcite.sql.SqlDynamicParam;
import org.apache.calcite.sql.SqlExplain;
import org.apache.calcite.sql.SqlExplainFormat;
import org.apache.calcite.sql.SqlExplainLevel;
import org.apache.calcite.sql.SqlFunction;
import org.apache.calcite.sql.SqlFunctionCategory;
import org.apache.calcite.sql.SqlIdentifier;
import org.apache.calcite.sql.SqlInsert;
import org.apache.calcite.sql.SqlInsertKeyword;
import org.apache.calcite.sql.SqlIntervalLiteral;
import org.apache.calcite.sql.SqlIntervalQualifier;
import org.apache.calcite.sql.SqlJdbcDataTypeName;
import org.apache.calcite.sql.SqlJdbcFunctionCall;
import org.apache.calcite.sql.SqlJoin;
import org.apache.calcite.sql.SqlJsonConstructorNullClause;
import org.apache.calcite.sql.SqlJsonEncoding;
import org.apache.calcite.sql.SqlJsonExistsErrorBehavior;
import org.apache.calcite.sql.SqlJsonEmptyOrError;
import org.apache.calcite.sql.SqlJsonQueryEmptyOrErrorBehavior;
import org.apache.calcite.sql.SqlJsonQueryWrapperBehavior;
import org.apache.calcite.sql.SqlJsonValueEmptyOrErrorBehavior;
import org.apache.calcite.sql.SqlKind;
import org.apache.calcite.sql.SqlLiteral;
import org.apache.calcite.sql.SqlMatchRecognize;
import org.apache.calcite.sql.SqlMerge;
import org.apache.calcite.sql.SqlNode;
import org.apache.calcite.sql.SqlNodeList;
import org.apache.calcite.sql.SqlNumericLiteral;
import org.apache.calcite.sql.SqlOperator;
import org.apache.calcite.sql.SqlOrderBy;
import org.apache.calcite.sql.SqlPostfixOperator;
import org.apache.calcite.sql.SqlPrefixOperator;
import org.apache.calcite.sql.SqlRowTypeNameSpec;
import org.apache.calcite.sql.SqlSampleSpec;
import org.apache.calcite.sql.SqlSelect;
import org.apache.calcite.sql.SqlSelectKeyword;
import org.apache.calcite.sql.SqlSetOption;
import org.apache.calcite.sql.SqlSnapshot;
import org.apache.calcite.sql.SqlTimeLiteral;
import org.apache.calcite.sql.SqlTimestampLiteral;
import org.apache.calcite.sql.SqlTypeNameSpec;
import org.apache.calcite.sql.SqlUnnestOperator;
import org.apache.calcite.sql.SqlUpdate;
import org.apache.calcite.sql.SqlUserDefinedTypeNameSpec;
import org.apache.calcite.sql.SqlUtil;
import org.apache.calcite.sql.SqlWindow;
import org.apache.calcite.sql.SqlWith;
import org.apache.calcite.sql.SqlWithItem;
import org.apache.calcite.sql.fun.SqlCase;
import org.apache.calcite.sql.fun.SqlLibraryOperators;
import org.apache.calcite.sql.fun.SqlStdOperatorTable;
import org.apache.calcite.sql.fun.SqlTrimFunction;
import org.apache.calcite.sql.parser.Span;
import org.apache.calcite.sql.parser.SqlAbstractParserImpl;
import org.apache.calcite.sql.parser.SqlParseException;
import org.apache.calcite.sql.parser.SqlParser;
import org.apache.calcite.sql.parser.SqlParserImplFactory;
import org.apache.calcite.sql.parser.SqlParserPos;
import org.apache.calcite.sql.parser.SqlParserUtil;
import org.apache.calcite.sql.type.SqlTypeName;
import org.apache.calcite.sql.validate.SqlConformance;
import org.apache.calcite.util.Glossary;
import org.apache.calcite.util.NlsString;
import org.apache.calcite.util.Pair;
import org.apache.calcite.util.SourceStringReader;
import org.apache.calcite.util.Util;
import org.apache.calcite.util.trace.CalciteTrace;
import org.slf4j.Logger;
import java.io.Reader;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Collections;
import java.util.List;
import java.util.Locale;
import static org.apache.calcite.util.Static.RESOURCE;
/**
* SQL parser, generated from Parser.jj by JavaCC.
*
* The public wrapper for this parser is {@link SqlParser}.
*/
public class SqlDdlParserImpl extends SqlAbstractParserImpl implements SqlDdlParserImplConstants {
private static final Logger LOGGER = CalciteTrace.getParserTracer();
// Can't use quoted literal because of a bug in how JavaCC translates
// backslash-backslash.
private static final char BACKSLASH = 0x5c;
private static final char DOUBLE_QUOTE = 0x22;
private static final String DQ = DOUBLE_QUOTE + "";
private static final String DQDQ = DQ + DQ;
private static Metadata metadata;
private Casing unquotedCasing;
private Casing quotedCasing;
private int identifierMaxLength;
private SqlConformance conformance;
/**
* {@link SqlParserImplFactory} implementation for creating parser.
*/
public static final SqlParserImplFactory FACTORY = new SqlParserImplFactory() {
public SqlAbstractParserImpl getParser(Reader reader) {
final SqlDdlParserImpl parser = new SqlDdlParserImpl(reader);
if (reader instanceof SourceStringReader) {
final String sql =
((SourceStringReader) reader).getSourceString();
parser.setOriginalSql(sql);
}
return parser;
}
};
public SqlParseException normalizeException(Throwable ex) {
try {
if (ex instanceof ParseException) {
ex = cleanupParseException((ParseException) ex);
}
return convertException(ex);
} catch (ParseException e) {
throw new AssertionError(e);
}
}
public Metadata getMetadata() {
synchronized (SqlDdlParserImpl.class) {
if (metadata == null) {
metadata = new MetadataImpl(
new SqlDdlParserImpl(new java.io.StringReader("")));
}
return metadata;
}
}
public void setTabSize(int tabSize) {
jj_input_stream.setTabSize(tabSize);
}
public void switchTo(String stateName) {
int state = Arrays.asList(SqlDdlParserImplTokenManager.lexStateNames)
.indexOf(stateName);
token_source.SwitchTo(state);
}
public void setQuotedCasing(Casing quotedCasing) {
this.quotedCasing = quotedCasing;
}
public void setUnquotedCasing(Casing unquotedCasing) {
this.unquotedCasing = unquotedCasing;
}
public void setIdentifierMaxLength(int identifierMaxLength) {
this.identifierMaxLength = identifierMaxLength;
}
public void setConformance(SqlConformance conformance) {
this.conformance = conformance;
}
public SqlNode parseSqlExpressionEof() throws Exception {
return SqlExpressionEof();
}
public SqlNode parseSqlStmtEof() throws Exception {
return SqlStmtEof();
}
public SqlNodeList parseSqlStmtList() throws Exception {
return SqlStmtList();
}
private SqlNode extend(SqlNode table, SqlNodeList extendList) {
return SqlStdOperatorTable.EXTEND.createCall(
Span.of(table, extendList).pos(), table, extendList);
}
void debug_message1() throws ParseException {
LOGGER.info("{} , {}", getToken(0).image, getToken(1).image);
}
String unquotedIdentifier() throws ParseException {
return SqlParserUtil.strip(getToken(0).image, null, null, null,
unquotedCasing);
}
/**
* Allows parser to be extended with new types of table references. The
* default implementation of this production is empty.
*/
final public SqlNode ExtendedTableRef() throws ParseException {
UnusedExtension();
{if (true) return null;}
throw new Error("Missing return statement in function");
}
/**
* Allows an OVER clause following a table expression as an extension to
* standard SQL syntax. The default implementation of this production is empty.
*/
final public SqlNode TableOverOpt() throws ParseException {
{if (true) return null;}
throw new Error("Missing return statement in function");
}
/*
* Parses dialect-specific keywords immediately following the SELECT keyword.
*/
final public void SqlSelectKeywords(List keywords) throws ParseException {
E();
}
/*
* Parses dialect-specific keywords immediately following the INSERT keyword.
*/
final public void SqlInsertKeywords(List keywords) throws ParseException {
E();
}
/*
* Parse Floor/Ceil function parameters
*/
final public SqlNode FloorCeilOptions(Span s, boolean floorFlag) throws ParseException {
SqlNode node;
node = StandardFloorCeilOptions(s, floorFlag);
{if (true) return node;}
throw new Error("Missing return statement in function");
}
void E() throws ParseException {
}
List startList(Object o) throws ParseException {
List list = new ArrayList();
list.add(o);
return list;
}
protected SqlParserPos getPos() throws ParseException {
return new SqlParserPos(
token.beginLine,
token.beginColumn,
token.endLine,
token.endColumn);
}
Span span() throws ParseException {
return Span.of(getPos());
}
void checkQueryExpression(ExprContext exprContext) throws ParseException {
switch (exprContext) {
case ACCEPT_NON_QUERY:
case ACCEPT_SUB_QUERY:
case ACCEPT_CURSOR:
throw SqlUtil.newContextException(getPos(),
RESOURCE.illegalQueryExpression());
}
}
void checkNonQueryExpression(ExprContext exprContext) throws ParseException {
switch (exprContext) {
case ACCEPT_QUERY:
throw SqlUtil.newContextException(getPos(),
RESOURCE.illegalNonQueryExpression());
}
}
SqlParseException convertException(Throwable ex) throws ParseException {
if (ex instanceof SqlParseException) {
return (SqlParseException) ex;
}
SqlParserPos pos = null;
int[][] expectedTokenSequences = null;
String[] tokenImage = null;
if (ex instanceof ParseException) {
ParseException pex = (ParseException) ex;
expectedTokenSequences = pex.expectedTokenSequences;
tokenImage = pex.tokenImage;
if (pex.currentToken != null) {
final Token token = pex.currentToken.next;
pos = new SqlParserPos(
token.beginLine,
token.beginColumn,
token.endLine,
token.endColumn);
}
} else if (ex instanceof TokenMgrError) {
TokenMgrError tme = (TokenMgrError) ex;
expectedTokenSequences = null;
tokenImage = null;
// Example:
// Lexical error at line 3, column 24. Encountered "#" after "a".
final java.util.regex.Pattern pattern = java.util.regex.Pattern.compile(
"(?s)Lexical error at line ([0-9]+), column ([0-9]+).*");
java.util.regex.Matcher matcher = pattern.matcher(ex.getMessage());
if (matcher.matches()) {
int line = Integer.parseInt(matcher.group(1));
int column = Integer.parseInt(matcher.group(2));
pos = new SqlParserPos(line, column, line, column);
}
} else if (ex instanceof CalciteContextException) {
// CalciteContextException is the standard wrapper for exceptions
// produced by the validator, but in the parser, the standard is
// SqlParseException; so, strip it away. In case you were wondering,
// the CalciteContextException appears because the parser
// occasionally calls into validator-style code such as
// SqlSpecialOperator.reduceExpr.
CalciteContextException ece =
(CalciteContextException) ex;
pos = new SqlParserPos(
ece.getPosLine(),
ece.getPosColumn(),
ece.getEndPosLine(),
ece.getEndPosColumn());
ex = ece.getCause();
}
return new SqlParseException(
ex.getMessage(), pos, expectedTokenSequences, tokenImage, ex);
}
ParseException cleanupParseException(ParseException ex) throws ParseException {
if (ex.expectedTokenSequences == null) {
return ex;
}
int iIdentifier = Arrays.asList(ex.tokenImage).indexOf("");
// Find all sequences in the error which contain identifier. For
// example,
// {}
// {A}
// {B, C}
// {D, }
// {D, A}
// {D, B}
//
// would yield
// {}
// {D}
boolean id = false;
final List prefixList = new ArrayList();
for (int i = 0; i < ex.expectedTokenSequences.length; ++i) {
int[] seq = ex.expectedTokenSequences[i];
int j = seq.length - 1;
int i1 = seq[j];
if (i1 == iIdentifier) {
int[] prefix = new int[j];
System.arraycopy(seq, 0, prefix, 0, j);
prefixList.add(prefix);
}
}
if (prefixList.isEmpty()) {
return ex;
}
int[][] prefixes = (int[][])
prefixList.toArray(new int[prefixList.size()][]);
// Since was one of the possible productions,
// we know that the parser will also have included all
// of the non-reserved keywords (which are treated as
// identifiers in non-keyword contexts). So, now we need
// to clean those out, since they're totally irrelevant.
final List list = new ArrayList();
Metadata metadata = getMetadata();
for (int i = 0; i < ex.expectedTokenSequences.length; ++i) {
int [] seq = ex.expectedTokenSequences[i];
String tokenImage = ex.tokenImage[seq[seq.length - 1]];
String token = SqlParserUtil.getTokenVal(tokenImage);
if (token == null || !metadata.isNonReservedKeyword(token)) {
list.add(seq);
continue;
}
boolean match = matchesPrefix(seq, prefixes);
if (!match) {
list.add(seq);
}
}
ex.expectedTokenSequences =
(int [][]) list.toArray(new int [list.size()][]);
return ex;
}
boolean matchesPrefix(int[] seq, int[][] prefixes) throws ParseException {
nextPrefix:
for (int[] prefix : prefixes) {
if (seq.length == prefix.length + 1) {
for (int k = 0; k < prefix.length; k++) {
if (prefix[k] != seq[k]) {
continue nextPrefix;
}
}
return true;
}
}
return false;
}
/*****************************************
* Syntactical Descriptions *
*****************************************/
/**
* Parses either a row expression or a query expression with an optional
* ORDER BY.
*
* Postgres syntax for limit:
*
*
* [ LIMIT { count | ALL } ]
* [ OFFSET start ]
*
*
* MySQL syntax for limit:
*
*
* [ LIMIT { count | start, count } ]
*
*
* SQL:2008 syntax for limit:
*
*
* [ OFFSET start { ROW | ROWS } ]
* [ FETCH { FIRST | NEXT } [ count ] { ROW | ROWS } ONLY ]
*
*/
final public SqlNode OrderedQueryOrExpr(ExprContext exprContext) throws ParseException {
SqlNode e;
SqlNodeList orderBy = null;
SqlNode start = null;
SqlNode count = null;
e = QueryOrExpr(exprContext);
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case ORDER:
// use the syntactic type of the expression we just parsed
// to decide whether ORDER BY makes sense
orderBy = OrderBy(e.isA(SqlKind.QUERY));
break;
default:
jj_la1[0] = jj_gen;
;
}
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case LIMIT:
jj_consume_token(LIMIT);
if (jj_2_1(2)) {
start = UnsignedNumericLiteralOrParam();
jj_consume_token(COMMA);
count = UnsignedNumericLiteralOrParam();
if (!this.conformance.isLimitStartCountAllowed()) {
{if (true) throw SqlUtil.newContextException(getPos(), RESOURCE.limitStartCountNotAllowed());}
}
} else {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case UNSIGNED_INTEGER_LITERAL:
case APPROX_NUMERIC_LITERAL:
case DECIMAL_NUMERIC_LITERAL:
case HOOK:
count = UnsignedNumericLiteralOrParam();
break;
case ALL:
jj_consume_token(ALL);
break;
default:
jj_la1[1] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
}
break;
default:
jj_la1[2] = jj_gen;
;
}
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case OFFSET:
jj_consume_token(OFFSET);
start = UnsignedNumericLiteralOrParam();
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case ROW:
case ROWS:
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case ROW:
jj_consume_token(ROW);
break;
case ROWS:
jj_consume_token(ROWS);
break;
default:
jj_la1[3] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
break;
default:
jj_la1[4] = jj_gen;
;
}
break;
default:
jj_la1[5] = jj_gen;
;
}
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case FETCH:
jj_consume_token(FETCH);
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case FIRST:
jj_consume_token(FIRST);
break;
case NEXT:
jj_consume_token(NEXT);
break;
default:
jj_la1[6] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
count = UnsignedNumericLiteralOrParam();
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case ROW:
jj_consume_token(ROW);
break;
case ROWS:
jj_consume_token(ROWS);
break;
default:
jj_la1[7] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
jj_consume_token(ONLY);
break;
default:
jj_la1[8] = jj_gen;
;
}
if (orderBy != null || start != null || count != null) {
if (orderBy == null) {
orderBy = SqlNodeList.EMPTY;
}
e = new SqlOrderBy(getPos(), e, orderBy, start, count);
}
{if (true) return e;}
throw new Error("Missing return statement in function");
}
/**
* Parses a leaf in a query expression (SELECT, VALUES or TABLE).
*/
final public SqlNode LeafQuery(ExprContext exprContext) throws ParseException {
SqlNode e;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case SELECT:
// ensure a query is legal in this context
checkQueryExpression(exprContext);
e = SqlSelect();
{if (true) return e;}
break;
case VALUES:
e = TableConstructor();
{if (true) return e;}
break;
case TABLE:
e = ExplicitTable(getPos());
{if (true) return e;}
break;
default:
jj_la1[9] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
throw new Error("Missing return statement in function");
}
/**
* Parses a parenthesized query or single row expression.
*/
final public SqlNode ParenthesizedExpression(ExprContext exprContext) throws ParseException {
SqlNode e;
jj_consume_token(LPAREN);
// we've now seen left paren, so queries inside should
// be allowed as sub-queries
switch (exprContext) {
case ACCEPT_SUB_QUERY:
exprContext = ExprContext.ACCEPT_NONCURSOR;
break;
case ACCEPT_CURSOR:
exprContext = ExprContext.ACCEPT_ALL;
break;
}
e = OrderedQueryOrExpr(exprContext);
jj_consume_token(RPAREN);
{if (true) return e;}
throw new Error("Missing return statement in function");
}
/**
* Parses a parenthesized query or comma-list of row expressions.
*
* REVIEW jvs 8-Feb-2004: There's a small hole in this production. It can be
* used to construct something like
*
*
* WHERE x IN (select count(*) from t where c=d,5)
*
*
* which should be illegal. The above is interpreted as equivalent to
*
*
* WHERE x IN ((select count(*) from t where c=d),5)
*
*
* which is a legal use of a sub-query. The only way to fix the hole is to
* be able to remember whether a subexpression was parenthesized or not, which
* means preserving parentheses in the SqlNode tree. This is probably
* desirable anyway for use in purely syntactic parsing applications (e.g. SQL
* pretty-printer). However, if this is done, it's important to also make
* isA() on the paren node call down to its operand so that we can
* always correctly discriminate a query from a row expression.
*/
final public SqlNodeList ParenthesizedQueryOrCommaList(ExprContext exprContext) throws ParseException {
SqlNode e;
List list;
ExprContext firstExprContext = exprContext;
final Span s;
jj_consume_token(LPAREN);
// we've now seen left paren, so a query by itself should
// be interpreted as a sub-query
s = span();
switch (exprContext) {
case ACCEPT_SUB_QUERY:
firstExprContext = ExprContext.ACCEPT_NONCURSOR;
break;
case ACCEPT_CURSOR:
firstExprContext = ExprContext.ACCEPT_ALL;
break;
}
e = OrderedQueryOrExpr(firstExprContext);
list = startList(e);
label_1:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case COMMA:
;
break;
default:
jj_la1[10] = jj_gen;
break label_1;
}
jj_consume_token(COMMA);
// a comma-list can't appear where only a query is expected
checkNonQueryExpression(exprContext);
e = Expression(exprContext);
list.add(e);
}
jj_consume_token(RPAREN);
{if (true) return new SqlNodeList(list, s.end(this));}
throw new Error("Missing return statement in function");
}
/** As ParenthesizedQueryOrCommaList, but allows DEFAULT
* in place of any of the expressions. For example,
* {@code (x, DEFAULT, null, DEFAULT)}. */
final public SqlNodeList ParenthesizedQueryOrCommaListWithDefault(ExprContext exprContext) throws ParseException {
SqlNode e;
List list;
ExprContext firstExprContext = exprContext;
final Span s;
jj_consume_token(LPAREN);
// we've now seen left paren, so a query by itself should
// be interpreted as a sub-query
s = span();
switch (exprContext) {
case ACCEPT_SUB_QUERY:
firstExprContext = ExprContext.ACCEPT_NONCURSOR;
break;
case ACCEPT_CURSOR:
firstExprContext = ExprContext.ACCEPT_ALL;
break;
}
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case A:
case ABS:
case ABSENT:
case ABSOLUTE:
case ACTION:
case ADA:
case ADD:
case ADMIN:
case AFTER:
case ALWAYS:
case APPLY:
case ARRAY:
case ASC:
case ASSERTION:
case ASSIGNMENT:
case ATTRIBUTE:
case ATTRIBUTES:
case AVG:
case BEFORE:
case BERNOULLI:
case BREADTH:
case C:
case CARDINALITY:
case CASCADE:
case CASE:
case CAST:
case CATALOG:
case CATALOG_NAME:
case CEIL:
case CEILING:
case CENTURY:
case CHAIN:
case CHAR_LENGTH:
case CHARACTER_LENGTH:
case CHARACTER_SET_CATALOG:
case CHARACTER_SET_NAME:
case CHARACTER_SET_SCHEMA:
case CHARACTERISTICS:
case CHARACTERS:
case CLASSIFIER:
case CLASS_ORIGIN:
case COALESCE:
case COBOL:
case COLLATION:
case COLLATION_CATALOG:
case COLLATION_NAME:
case COLLATION_SCHEMA:
case COLLECT:
case COLUMN_NAME:
case COMMAND_FUNCTION:
case COMMAND_FUNCTION_CODE:
case COMMITTED:
case CONDITIONAL:
case CONDITION_NUMBER:
case CONNECTION:
case CONNECTION_NAME:
case CONSTRAINT_CATALOG:
case CONSTRAINT_NAME:
case CONSTRAINT_SCHEMA:
case CONSTRAINTS:
case CONSTRUCTOR:
case CONTINUE:
case CONVERT:
case COUNT:
case COVAR_POP:
case COVAR_SAMP:
case CUME_DIST:
case CURRENT:
case CURRENT_CATALOG:
case CURRENT_DATE:
case CURRENT_DEFAULT_TRANSFORM_GROUP:
case CURRENT_PATH:
case CURRENT_ROLE:
case CURRENT_SCHEMA:
case CURRENT_TIME:
case CURRENT_TIMESTAMP:
case CURRENT_USER:
case CURSOR:
case CURSOR_NAME:
case DATA:
case DATABASE:
case DATE:
case DATETIME_INTERVAL_CODE:
case DATETIME_INTERVAL_PRECISION:
case DECADE:
case DEFAULTS:
case DEFERRABLE:
case DEFERRED:
case DEFINED:
case DEFINER:
case DEGREE:
case DENSE_RANK:
case DEPTH:
case DERIVED:
case DESC:
case DESCRIPTION:
case DESCRIPTOR:
case DIAGNOSTICS:
case DISPATCH:
case DOMAIN:
case DOW:
case DOY:
case DYNAMIC_FUNCTION:
case DYNAMIC_FUNCTION_CODE:
case ELEMENT:
case ENCODING:
case EPOCH:
case ERROR:
case EXCEPTION:
case EXCLUDE:
case EXCLUDING:
case EXISTS:
case EXP:
case EXTRACT:
case FALSE:
case FINAL:
case FIRST:
case FIRST_VALUE:
case FLOOR:
case FOLLOWING:
case FORMAT:
case FORTRAN:
case FOUND:
case FRAC_SECOND:
case FUSION:
case G:
case GENERAL:
case GENERATED:
case GEOMETRY:
case GO:
case GOTO:
case GRANTED:
case GROUPING:
case HIERARCHY:
case HOUR:
case IGNORE:
case IMMEDIATE:
case IMMEDIATELY:
case IMPLEMENTATION:
case INCLUDING:
case INCREMENT:
case INITIALLY:
case INPUT:
case INSTANCE:
case INSTANTIABLE:
case INTERVAL:
case INVOKER:
case ISODOW:
case ISOYEAR:
case ISOLATION:
case JAVA:
case JSON:
case JSON_ARRAY:
case JSON_ARRAYAGG:
case JSON_EXISTS:
case JSON_OBJECT:
case JSON_OBJECTAGG:
case JSON_QUERY:
case JSON_VALUE:
case K:
case KEY:
case KEY_MEMBER:
case KEY_TYPE:
case LABEL:
case LAG:
case LAST:
case LAST_VALUE:
case LEAD:
case LEFT:
case LENGTH:
case LEVEL:
case LIBRARY:
case LN:
case LOCALTIME:
case LOCALTIMESTAMP:
case LOCATOR:
case LOWER:
case M:
case MAP:
case MATCHED:
case MATCH_NUMBER:
case MAX:
case MAXVALUE:
case MESSAGE_LENGTH:
case MESSAGE_OCTET_LENGTH:
case MESSAGE_TEXT:
case MICROSECOND:
case MILLISECOND:
case MILLENNIUM:
case MIN:
case MINUTE:
case MINVALUE:
case MOD:
case MONTH:
case MORE_:
case MULTISET:
case MUMPS:
case NAME:
case NAMES:
case NANOSECOND:
case NESTING:
case NEW:
case NEXT:
case NORMALIZED:
case NOT:
case NTH_VALUE:
case NTILE:
case NULL:
case NULLABLE:
case NULLIF:
case NULLS:
case NUMBER:
case OBJECT:
case OCTET_LENGTH:
case OCTETS:
case OPTION:
case OPTIONS:
case ORDERING:
case ORDINALITY:
case OTHERS:
case OUTPUT:
case OVERLAY:
case OVERRIDING:
case PAD:
case PARAMETER_MODE:
case PARAMETER_NAME:
case PARAMETER_ORDINAL_POSITION:
case PARAMETER_SPECIFIC_CATALOG:
case PARAMETER_SPECIFIC_NAME:
case PARAMETER_SPECIFIC_SCHEMA:
case PARTIAL:
case PASCAL:
case PASSING:
case PASSTHROUGH:
case PAST:
case PATH:
case PERCENT_RANK:
case PERIOD:
case PLACING:
case PLAN:
case PLI:
case POSITION:
case POWER:
case PRECEDING:
case PRESERVE:
case PREV:
case PRIOR:
case PRIVILEGES:
case PUBLIC:
case QUARTER:
case RANK:
case READ:
case REGR_COUNT:
case REGR_SXX:
case REGR_SYY:
case RELATIVE:
case REPEATABLE:
case REPLACE:
case RESPECT:
case RESTART:
case RESTRICT:
case RETURNED_CARDINALITY:
case RETURNED_LENGTH:
case RETURNED_OCTET_LENGTH:
case RETURNED_SQLSTATE:
case RETURNING:
case RIGHT:
case ROLE:
case ROUTINE:
case ROUTINE_CATALOG:
case ROUTINE_NAME:
case ROUTINE_SCHEMA:
case ROW:
case ROW_COUNT:
case ROW_NUMBER:
case RUNNING:
case SCALAR:
case SCALE:
case SCHEMA:
case SCHEMA_NAME:
case SCOPE_CATALOGS:
case SCOPE_NAME:
case SCOPE_SCHEMA:
case SECOND:
case SECTION:
case SECURITY:
case SELECT:
case SELF:
case SEQUENCE:
case SERIALIZABLE:
case SERVER:
case SERVER_NAME:
case SESSION:
case SESSION_USER:
case SETS:
case SIMPLE:
case SIZE:
case SOURCE:
case SPACE:
case SPECIFIC:
case SPECIFIC_NAME:
case SQL_BIGINT:
case SQL_BINARY:
case SQL_BIT:
case SQL_BLOB:
case SQL_BOOLEAN:
case SQL_CHAR:
case SQL_CLOB:
case SQL_DATE:
case SQL_DECIMAL:
case SQL_DOUBLE:
case SQL_FLOAT:
case SQL_INTEGER:
case SQL_INTERVAL_DAY:
case SQL_INTERVAL_DAY_TO_HOUR:
case SQL_INTERVAL_DAY_TO_MINUTE:
case SQL_INTERVAL_DAY_TO_SECOND:
case SQL_INTERVAL_HOUR:
case SQL_INTERVAL_HOUR_TO_MINUTE:
case SQL_INTERVAL_HOUR_TO_SECOND:
case SQL_INTERVAL_MINUTE:
case SQL_INTERVAL_MINUTE_TO_SECOND:
case SQL_INTERVAL_MONTH:
case SQL_INTERVAL_SECOND:
case SQL_INTERVAL_YEAR:
case SQL_INTERVAL_YEAR_TO_MONTH:
case SQL_LONGVARBINARY:
case SQL_LONGVARCHAR:
case SQL_LONGVARNCHAR:
case SQL_NCHAR:
case SQL_NCLOB:
case SQL_NUMERIC:
case SQL_NVARCHAR:
case SQL_REAL:
case SQL_SMALLINT:
case SQL_TIME:
case SQL_TIMESTAMP:
case SQL_TINYINT:
case SQL_TSI_DAY:
case SQL_TSI_FRAC_SECOND:
case SQL_TSI_HOUR:
case SQL_TSI_MICROSECOND:
case SQL_TSI_MINUTE:
case SQL_TSI_MONTH:
case SQL_TSI_QUARTER:
case SQL_TSI_SECOND:
case SQL_TSI_WEEK:
case SQL_TSI_YEAR:
case SQL_VARBINARY:
case SQL_VARCHAR:
case SQRT:
case STATE:
case STATEMENT:
case STDDEV_POP:
case STDDEV_SAMP:
case STRUCTURE:
case STYLE:
case SUBCLASS_ORIGIN:
case SUBSTITUTE:
case SUBSTRING:
case SUM:
case SYSTEM_USER:
case TABLE:
case TABLE_NAME:
case TEMPORARY:
case TIES:
case TIME:
case TIMESTAMP:
case TIMESTAMPADD:
case TIMESTAMPDIFF:
case TOP_LEVEL_COUNT:
case TRANSACTION:
case TRANSACTIONS_ACTIVE:
case TRANSACTIONS_COMMITTED:
case TRANSACTIONS_ROLLED_BACK:
case TRANSFORM:
case TRANSFORMS:
case TRANSLATE:
case TRIGGER_CATALOG:
case TRIGGER_NAME:
case TRIGGER_SCHEMA:
case TRIM:
case TRUE:
case TRUNCATE:
case TYPE:
case UNBOUNDED:
case UNCOMMITTED:
case UNCONDITIONAL:
case UNDER:
case UNKNOWN:
case UNNAMED:
case UPPER:
case USAGE:
case USER:
case USER_DEFINED_TYPE_CATALOG:
case USER_DEFINED_TYPE_CODE:
case USER_DEFINED_TYPE_NAME:
case USER_DEFINED_TYPE_SCHEMA:
case UTF8:
case UTF16:
case UTF32:
case VALUES:
case VAR_POP:
case VAR_SAMP:
case VERSION:
case VIEW:
case WEEK:
case WITH:
case WORK:
case WRAPPER:
case WRITE:
case XML:
case YEAR:
case ZONE:
case IF:
case MATERIALIZED:
case STORED:
case VIRTUAL:
case JAR:
case FILE:
case ARCHIVE:
case UNSIGNED_INTEGER_LITERAL:
case APPROX_NUMERIC_LITERAL:
case DECIMAL_NUMERIC_LITERAL:
case BINARY_STRING_LITERAL:
case QUOTED_STRING:
case PREFIXED_STRING_LITERAL:
case UNICODE_STRING_LITERAL:
case LPAREN:
case LBRACE_D:
case LBRACE_T:
case LBRACE_TS:
case LBRACE_FN:
case HOOK:
case PLUS:
case MINUS:
case BRACKET_QUOTED_IDENTIFIER:
case QUOTED_IDENTIFIER:
case BACK_QUOTED_IDENTIFIER:
case IDENTIFIER:
case UNICODE_QUOTED_IDENTIFIER:
e = OrderedQueryOrExpr(firstExprContext);
break;
case DEFAULT_:
e = Default();
break;
default:
jj_la1[11] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
list = startList(e);
label_2:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case COMMA:
;
break;
default:
jj_la1[12] = jj_gen;
break label_2;
}
jj_consume_token(COMMA);
// a comma-list can't appear where only a query is expected
checkNonQueryExpression(exprContext);
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case A:
case ABS:
case ABSENT:
case ABSOLUTE:
case ACTION:
case ADA:
case ADD:
case ADMIN:
case AFTER:
case ALWAYS:
case APPLY:
case ARRAY:
case ASC:
case ASSERTION:
case ASSIGNMENT:
case ATTRIBUTE:
case ATTRIBUTES:
case AVG:
case BEFORE:
case BERNOULLI:
case BREADTH:
case C:
case CARDINALITY:
case CASCADE:
case CASE:
case CAST:
case CATALOG:
case CATALOG_NAME:
case CEIL:
case CEILING:
case CENTURY:
case CHAIN:
case CHAR_LENGTH:
case CHARACTER_LENGTH:
case CHARACTER_SET_CATALOG:
case CHARACTER_SET_NAME:
case CHARACTER_SET_SCHEMA:
case CHARACTERISTICS:
case CHARACTERS:
case CLASSIFIER:
case CLASS_ORIGIN:
case COALESCE:
case COBOL:
case COLLATION:
case COLLATION_CATALOG:
case COLLATION_NAME:
case COLLATION_SCHEMA:
case COLLECT:
case COLUMN_NAME:
case COMMAND_FUNCTION:
case COMMAND_FUNCTION_CODE:
case COMMITTED:
case CONDITIONAL:
case CONDITION_NUMBER:
case CONNECTION:
case CONNECTION_NAME:
case CONSTRAINT_CATALOG:
case CONSTRAINT_NAME:
case CONSTRAINT_SCHEMA:
case CONSTRAINTS:
case CONSTRUCTOR:
case CONTINUE:
case CONVERT:
case COUNT:
case COVAR_POP:
case COVAR_SAMP:
case CUME_DIST:
case CURRENT:
case CURRENT_CATALOG:
case CURRENT_DATE:
case CURRENT_DEFAULT_TRANSFORM_GROUP:
case CURRENT_PATH:
case CURRENT_ROLE:
case CURRENT_SCHEMA:
case CURRENT_TIME:
case CURRENT_TIMESTAMP:
case CURRENT_USER:
case CURSOR:
case CURSOR_NAME:
case DATA:
case DATABASE:
case DATE:
case DATETIME_INTERVAL_CODE:
case DATETIME_INTERVAL_PRECISION:
case DECADE:
case DEFAULTS:
case DEFERRABLE:
case DEFERRED:
case DEFINED:
case DEFINER:
case DEGREE:
case DENSE_RANK:
case DEPTH:
case DERIVED:
case DESC:
case DESCRIPTION:
case DESCRIPTOR:
case DIAGNOSTICS:
case DISPATCH:
case DOMAIN:
case DOW:
case DOY:
case DYNAMIC_FUNCTION:
case DYNAMIC_FUNCTION_CODE:
case ELEMENT:
case ENCODING:
case EPOCH:
case ERROR:
case EXCEPTION:
case EXCLUDE:
case EXCLUDING:
case EXISTS:
case EXP:
case EXTRACT:
case FALSE:
case FINAL:
case FIRST:
case FIRST_VALUE:
case FLOOR:
case FOLLOWING:
case FORMAT:
case FORTRAN:
case FOUND:
case FRAC_SECOND:
case FUSION:
case G:
case GENERAL:
case GENERATED:
case GEOMETRY:
case GO:
case GOTO:
case GRANTED:
case GROUPING:
case HIERARCHY:
case HOUR:
case IGNORE:
case IMMEDIATE:
case IMMEDIATELY:
case IMPLEMENTATION:
case INCLUDING:
case INCREMENT:
case INITIALLY:
case INPUT:
case INSTANCE:
case INSTANTIABLE:
case INTERVAL:
case INVOKER:
case ISODOW:
case ISOYEAR:
case ISOLATION:
case JAVA:
case JSON:
case JSON_ARRAY:
case JSON_ARRAYAGG:
case JSON_EXISTS:
case JSON_OBJECT:
case JSON_OBJECTAGG:
case JSON_QUERY:
case JSON_VALUE:
case K:
case KEY:
case KEY_MEMBER:
case KEY_TYPE:
case LABEL:
case LAG:
case LAST:
case LAST_VALUE:
case LEAD:
case LEFT:
case LENGTH:
case LEVEL:
case LIBRARY:
case LN:
case LOCALTIME:
case LOCALTIMESTAMP:
case LOCATOR:
case LOWER:
case M:
case MAP:
case MATCHED:
case MATCH_NUMBER:
case MAX:
case MAXVALUE:
case MESSAGE_LENGTH:
case MESSAGE_OCTET_LENGTH:
case MESSAGE_TEXT:
case MICROSECOND:
case MILLISECOND:
case MILLENNIUM:
case MIN:
case MINUTE:
case MINVALUE:
case MOD:
case MONTH:
case MORE_:
case MULTISET:
case MUMPS:
case NAME:
case NAMES:
case NANOSECOND:
case NESTING:
case NEW:
case NEXT:
case NORMALIZED:
case NOT:
case NTH_VALUE:
case NTILE:
case NULL:
case NULLABLE:
case NULLIF:
case NULLS:
case NUMBER:
case OBJECT:
case OCTET_LENGTH:
case OCTETS:
case OPTION:
case OPTIONS:
case ORDERING:
case ORDINALITY:
case OTHERS:
case OUTPUT:
case OVERLAY:
case OVERRIDING:
case PAD:
case PARAMETER_MODE:
case PARAMETER_NAME:
case PARAMETER_ORDINAL_POSITION:
case PARAMETER_SPECIFIC_CATALOG:
case PARAMETER_SPECIFIC_NAME:
case PARAMETER_SPECIFIC_SCHEMA:
case PARTIAL:
case PASCAL:
case PASSING:
case PASSTHROUGH:
case PAST:
case PATH:
case PERCENT_RANK:
case PERIOD:
case PLACING:
case PLAN:
case PLI:
case POSITION:
case POWER:
case PRECEDING:
case PRESERVE:
case PREV:
case PRIOR:
case PRIVILEGES:
case PUBLIC:
case QUARTER:
case RANK:
case READ:
case REGR_COUNT:
case REGR_SXX:
case REGR_SYY:
case RELATIVE:
case REPEATABLE:
case REPLACE:
case RESPECT:
case RESTART:
case RESTRICT:
case RETURNED_CARDINALITY:
case RETURNED_LENGTH:
case RETURNED_OCTET_LENGTH:
case RETURNED_SQLSTATE:
case RETURNING:
case RIGHT:
case ROLE:
case ROUTINE:
case ROUTINE_CATALOG:
case ROUTINE_NAME:
case ROUTINE_SCHEMA:
case ROW:
case ROW_COUNT:
case ROW_NUMBER:
case RUNNING:
case SCALAR:
case SCALE:
case SCHEMA:
case SCHEMA_NAME:
case SCOPE_CATALOGS:
case SCOPE_NAME:
case SCOPE_SCHEMA:
case SECOND:
case SECTION:
case SECURITY:
case SELF:
case SEQUENCE:
case SERIALIZABLE:
case SERVER:
case SERVER_NAME:
case SESSION:
case SESSION_USER:
case SETS:
case SIMPLE:
case SIZE:
case SOURCE:
case SPACE:
case SPECIFIC:
case SPECIFIC_NAME:
case SQL_BIGINT:
case SQL_BINARY:
case SQL_BIT:
case SQL_BLOB:
case SQL_BOOLEAN:
case SQL_CHAR:
case SQL_CLOB:
case SQL_DATE:
case SQL_DECIMAL:
case SQL_DOUBLE:
case SQL_FLOAT:
case SQL_INTEGER:
case SQL_INTERVAL_DAY:
case SQL_INTERVAL_DAY_TO_HOUR:
case SQL_INTERVAL_DAY_TO_MINUTE:
case SQL_INTERVAL_DAY_TO_SECOND:
case SQL_INTERVAL_HOUR:
case SQL_INTERVAL_HOUR_TO_MINUTE:
case SQL_INTERVAL_HOUR_TO_SECOND:
case SQL_INTERVAL_MINUTE:
case SQL_INTERVAL_MINUTE_TO_SECOND:
case SQL_INTERVAL_MONTH:
case SQL_INTERVAL_SECOND:
case SQL_INTERVAL_YEAR:
case SQL_INTERVAL_YEAR_TO_MONTH:
case SQL_LONGVARBINARY:
case SQL_LONGVARCHAR:
case SQL_LONGVARNCHAR:
case SQL_NCHAR:
case SQL_NCLOB:
case SQL_NUMERIC:
case SQL_NVARCHAR:
case SQL_REAL:
case SQL_SMALLINT:
case SQL_TIME:
case SQL_TIMESTAMP:
case SQL_TINYINT:
case SQL_TSI_DAY:
case SQL_TSI_FRAC_SECOND:
case SQL_TSI_HOUR:
case SQL_TSI_MICROSECOND:
case SQL_TSI_MINUTE:
case SQL_TSI_MONTH:
case SQL_TSI_QUARTER:
case SQL_TSI_SECOND:
case SQL_TSI_WEEK:
case SQL_TSI_YEAR:
case SQL_VARBINARY:
case SQL_VARCHAR:
case SQRT:
case STATE:
case STATEMENT:
case STDDEV_POP:
case STDDEV_SAMP:
case STRUCTURE:
case STYLE:
case SUBCLASS_ORIGIN:
case SUBSTITUTE:
case SUBSTRING:
case SUM:
case SYSTEM_USER:
case TABLE_NAME:
case TEMPORARY:
case TIES:
case TIME:
case TIMESTAMP:
case TIMESTAMPADD:
case TIMESTAMPDIFF:
case TOP_LEVEL_COUNT:
case TRANSACTION:
case TRANSACTIONS_ACTIVE:
case TRANSACTIONS_COMMITTED:
case TRANSACTIONS_ROLLED_BACK:
case TRANSFORM:
case TRANSFORMS:
case TRANSLATE:
case TRIGGER_CATALOG:
case TRIGGER_NAME:
case TRIGGER_SCHEMA:
case TRIM:
case TRUE:
case TRUNCATE:
case TYPE:
case UNBOUNDED:
case UNCOMMITTED:
case UNCONDITIONAL:
case UNDER:
case UNKNOWN:
case UNNAMED:
case UPPER:
case USAGE:
case USER:
case USER_DEFINED_TYPE_CATALOG:
case USER_DEFINED_TYPE_CODE:
case USER_DEFINED_TYPE_NAME:
case USER_DEFINED_TYPE_SCHEMA:
case UTF8:
case UTF16:
case UTF32:
case VAR_POP:
case VAR_SAMP:
case VERSION:
case VIEW:
case WEEK:
case WORK:
case WRAPPER:
case WRITE:
case XML:
case YEAR:
case ZONE:
case IF:
case MATERIALIZED:
case STORED:
case VIRTUAL:
case JAR:
case FILE:
case ARCHIVE:
case UNSIGNED_INTEGER_LITERAL:
case APPROX_NUMERIC_LITERAL:
case DECIMAL_NUMERIC_LITERAL:
case BINARY_STRING_LITERAL:
case QUOTED_STRING:
case PREFIXED_STRING_LITERAL:
case UNICODE_STRING_LITERAL:
case LPAREN:
case LBRACE_D:
case LBRACE_T:
case LBRACE_TS:
case LBRACE_FN:
case HOOK:
case PLUS:
case MINUS:
case BRACKET_QUOTED_IDENTIFIER:
case QUOTED_IDENTIFIER:
case BACK_QUOTED_IDENTIFIER:
case IDENTIFIER:
case UNICODE_QUOTED_IDENTIFIER:
e = Expression(exprContext);
break;
case DEFAULT_:
e = Default();
break;
default:
jj_la1[13] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
list.add(e);
}
jj_consume_token(RPAREN);
{if (true) return new SqlNodeList(list, s.end(this));}
throw new Error("Missing return statement in function");
}
/**
* Parses function parameter lists including DISTINCT keyword recognition,
* DEFAULT, and named argument assignment.
*/
final public List FunctionParameterList(ExprContext exprContext) throws ParseException {
SqlNode e = null;
List list = new ArrayList();
jj_consume_token(LPAREN);
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case ALL:
case DISTINCT:
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case DISTINCT:
jj_consume_token(DISTINCT);
e = SqlSelectKeyword.DISTINCT.symbol(getPos());
break;
case ALL:
jj_consume_token(ALL);
e = SqlSelectKeyword.ALL.symbol(getPos());
break;
default:
jj_la1[14] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
break;
default:
jj_la1[15] = jj_gen;
;
}
list.add(e);
Arg0(list, exprContext);
label_3:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case COMMA:
;
break;
default:
jj_la1[16] = jj_gen;
break label_3;
}
jj_consume_token(COMMA);
// a comma-list can't appear where only a query is expected
checkNonQueryExpression(exprContext);
Arg(list, exprContext);
}
jj_consume_token(RPAREN);
{if (true) return list;}
throw new Error("Missing return statement in function");
}
final public void Arg0(List list, ExprContext exprContext) throws ParseException {
SqlIdentifier name = null;
SqlNode e = null;
final ExprContext firstExprContext;
{
// we've now seen left paren, so queries inside should
// be allowed as sub-queries
switch (exprContext) {
case ACCEPT_SUB_QUERY:
firstExprContext = ExprContext.ACCEPT_NONCURSOR;
break;
case ACCEPT_CURSOR:
firstExprContext = ExprContext.ACCEPT_ALL;
break;
default:
firstExprContext = exprContext;
break;
}
}
if (jj_2_2(2)) {
name = SimpleIdentifier();
jj_consume_token(NAMED_ARGUMENT_ASSIGNMENT);
} else {
;
}
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case DEFAULT_:
e = Default();
break;
case A:
case ABS:
case ABSENT:
case ABSOLUTE:
case ACTION:
case ADA:
case ADD:
case ADMIN:
case AFTER:
case ALWAYS:
case APPLY:
case ARRAY:
case ASC:
case ASSERTION:
case ASSIGNMENT:
case ATTRIBUTE:
case ATTRIBUTES:
case AVG:
case BEFORE:
case BERNOULLI:
case BREADTH:
case C:
case CARDINALITY:
case CASCADE:
case CASE:
case CAST:
case CATALOG:
case CATALOG_NAME:
case CEIL:
case CEILING:
case CENTURY:
case CHAIN:
case CHAR_LENGTH:
case CHARACTER_LENGTH:
case CHARACTER_SET_CATALOG:
case CHARACTER_SET_NAME:
case CHARACTER_SET_SCHEMA:
case CHARACTERISTICS:
case CHARACTERS:
case CLASSIFIER:
case CLASS_ORIGIN:
case COALESCE:
case COBOL:
case COLLATION:
case COLLATION_CATALOG:
case COLLATION_NAME:
case COLLATION_SCHEMA:
case COLLECT:
case COLUMN_NAME:
case COMMAND_FUNCTION:
case COMMAND_FUNCTION_CODE:
case COMMITTED:
case CONDITIONAL:
case CONDITION_NUMBER:
case CONNECTION:
case CONNECTION_NAME:
case CONSTRAINT_CATALOG:
case CONSTRAINT_NAME:
case CONSTRAINT_SCHEMA:
case CONSTRAINTS:
case CONSTRUCTOR:
case CONTINUE:
case CONVERT:
case COUNT:
case COVAR_POP:
case COVAR_SAMP:
case CUME_DIST:
case CURRENT:
case CURRENT_CATALOG:
case CURRENT_DATE:
case CURRENT_DEFAULT_TRANSFORM_GROUP:
case CURRENT_PATH:
case CURRENT_ROLE:
case CURRENT_SCHEMA:
case CURRENT_TIME:
case CURRENT_TIMESTAMP:
case CURRENT_USER:
case CURSOR:
case CURSOR_NAME:
case DATA:
case DATABASE:
case DATE:
case DATETIME_INTERVAL_CODE:
case DATETIME_INTERVAL_PRECISION:
case DECADE:
case DEFAULTS:
case DEFERRABLE:
case DEFERRED:
case DEFINED:
case DEFINER:
case DEGREE:
case DENSE_RANK:
case DEPTH:
case DERIVED:
case DESC:
case DESCRIPTION:
case DESCRIPTOR:
case DIAGNOSTICS:
case DISPATCH:
case DOMAIN:
case DOW:
case DOY:
case DYNAMIC_FUNCTION:
case DYNAMIC_FUNCTION_CODE:
case ELEMENT:
case ENCODING:
case EPOCH:
case ERROR:
case EXCEPTION:
case EXCLUDE:
case EXCLUDING:
case EXISTS:
case EXP:
case EXTRACT:
case FALSE:
case FINAL:
case FIRST:
case FIRST_VALUE:
case FLOOR:
case FOLLOWING:
case FORMAT:
case FORTRAN:
case FOUND:
case FRAC_SECOND:
case FUSION:
case G:
case GENERAL:
case GENERATED:
case GEOMETRY:
case GO:
case GOTO:
case GRANTED:
case GROUPING:
case HIERARCHY:
case HOUR:
case IGNORE:
case IMMEDIATE:
case IMMEDIATELY:
case IMPLEMENTATION:
case INCLUDING:
case INCREMENT:
case INITIALLY:
case INPUT:
case INSTANCE:
case INSTANTIABLE:
case INTERVAL:
case INVOKER:
case ISODOW:
case ISOYEAR:
case ISOLATION:
case JAVA:
case JSON:
case JSON_ARRAY:
case JSON_ARRAYAGG:
case JSON_EXISTS:
case JSON_OBJECT:
case JSON_OBJECTAGG:
case JSON_QUERY:
case JSON_VALUE:
case K:
case KEY:
case KEY_MEMBER:
case KEY_TYPE:
case LABEL:
case LAG:
case LAST:
case LAST_VALUE:
case LEAD:
case LEFT:
case LENGTH:
case LEVEL:
case LIBRARY:
case LN:
case LOCALTIME:
case LOCALTIMESTAMP:
case LOCATOR:
case LOWER:
case M:
case MAP:
case MATCHED:
case MATCH_NUMBER:
case MAX:
case MAXVALUE:
case MESSAGE_LENGTH:
case MESSAGE_OCTET_LENGTH:
case MESSAGE_TEXT:
case MICROSECOND:
case MILLISECOND:
case MILLENNIUM:
case MIN:
case MINUTE:
case MINVALUE:
case MOD:
case MONTH:
case MORE_:
case MULTISET:
case MUMPS:
case NAME:
case NAMES:
case NANOSECOND:
case NESTING:
case NEW:
case NEXT:
case NORMALIZED:
case NOT:
case NTH_VALUE:
case NTILE:
case NULL:
case NULLABLE:
case NULLIF:
case NULLS:
case NUMBER:
case OBJECT:
case OCTET_LENGTH:
case OCTETS:
case OPTION:
case OPTIONS:
case ORDERING:
case ORDINALITY:
case OTHERS:
case OUTPUT:
case OVERLAY:
case OVERRIDING:
case PAD:
case PARAMETER_MODE:
case PARAMETER_NAME:
case PARAMETER_ORDINAL_POSITION:
case PARAMETER_SPECIFIC_CATALOG:
case PARAMETER_SPECIFIC_NAME:
case PARAMETER_SPECIFIC_SCHEMA:
case PARTIAL:
case PASCAL:
case PASSING:
case PASSTHROUGH:
case PAST:
case PATH:
case PERCENT_RANK:
case PERIOD:
case PLACING:
case PLAN:
case PLI:
case POSITION:
case POWER:
case PRECEDING:
case PRESERVE:
case PREV:
case PRIOR:
case PRIVILEGES:
case PUBLIC:
case QUARTER:
case RANK:
case READ:
case REGR_COUNT:
case REGR_SXX:
case REGR_SYY:
case RELATIVE:
case REPEATABLE:
case REPLACE:
case RESPECT:
case RESTART:
case RESTRICT:
case RETURNED_CARDINALITY:
case RETURNED_LENGTH:
case RETURNED_OCTET_LENGTH:
case RETURNED_SQLSTATE:
case RETURNING:
case RIGHT:
case ROLE:
case ROUTINE:
case ROUTINE_CATALOG:
case ROUTINE_NAME:
case ROUTINE_SCHEMA:
case ROW:
case ROW_COUNT:
case ROW_NUMBER:
case RUNNING:
case SCALAR:
case SCALE:
case SCHEMA:
case SCHEMA_NAME:
case SCOPE_CATALOGS:
case SCOPE_NAME:
case SCOPE_SCHEMA:
case SECOND:
case SECTION:
case SECURITY:
case SELECT:
case SELF:
case SEQUENCE:
case SERIALIZABLE:
case SERVER:
case SERVER_NAME:
case SESSION:
case SESSION_USER:
case SETS:
case SIMPLE:
case SIZE:
case SOURCE:
case SPACE:
case SPECIFIC:
case SPECIFIC_NAME:
case SQL_BIGINT:
case SQL_BINARY:
case SQL_BIT:
case SQL_BLOB:
case SQL_BOOLEAN:
case SQL_CHAR:
case SQL_CLOB:
case SQL_DATE:
case SQL_DECIMAL:
case SQL_DOUBLE:
case SQL_FLOAT:
case SQL_INTEGER:
case SQL_INTERVAL_DAY:
case SQL_INTERVAL_DAY_TO_HOUR:
case SQL_INTERVAL_DAY_TO_MINUTE:
case SQL_INTERVAL_DAY_TO_SECOND:
case SQL_INTERVAL_HOUR:
case SQL_INTERVAL_HOUR_TO_MINUTE:
case SQL_INTERVAL_HOUR_TO_SECOND:
case SQL_INTERVAL_MINUTE:
case SQL_INTERVAL_MINUTE_TO_SECOND:
case SQL_INTERVAL_MONTH:
case SQL_INTERVAL_SECOND:
case SQL_INTERVAL_YEAR:
case SQL_INTERVAL_YEAR_TO_MONTH:
case SQL_LONGVARBINARY:
case SQL_LONGVARCHAR:
case SQL_LONGVARNCHAR:
case SQL_NCHAR:
case SQL_NCLOB:
case SQL_NUMERIC:
case SQL_NVARCHAR:
case SQL_REAL:
case SQL_SMALLINT:
case SQL_TIME:
case SQL_TIMESTAMP:
case SQL_TINYINT:
case SQL_TSI_DAY:
case SQL_TSI_FRAC_SECOND:
case SQL_TSI_HOUR:
case SQL_TSI_MICROSECOND:
case SQL_TSI_MINUTE:
case SQL_TSI_MONTH:
case SQL_TSI_QUARTER:
case SQL_TSI_SECOND:
case SQL_TSI_WEEK:
case SQL_TSI_YEAR:
case SQL_VARBINARY:
case SQL_VARCHAR:
case SQRT:
case STATE:
case STATEMENT:
case STDDEV_POP:
case STDDEV_SAMP:
case STRUCTURE:
case STYLE:
case SUBCLASS_ORIGIN:
case SUBSTITUTE:
case SUBSTRING:
case SUM:
case SYSTEM_USER:
case TABLE:
case TABLE_NAME:
case TEMPORARY:
case TIES:
case TIME:
case TIMESTAMP:
case TIMESTAMPADD:
case TIMESTAMPDIFF:
case TOP_LEVEL_COUNT:
case TRANSACTION:
case TRANSACTIONS_ACTIVE:
case TRANSACTIONS_COMMITTED:
case TRANSACTIONS_ROLLED_BACK:
case TRANSFORM:
case TRANSFORMS:
case TRANSLATE:
case TRIGGER_CATALOG:
case TRIGGER_NAME:
case TRIGGER_SCHEMA:
case TRIM:
case TRUE:
case TRUNCATE:
case TYPE:
case UNBOUNDED:
case UNCOMMITTED:
case UNCONDITIONAL:
case UNDER:
case UNKNOWN:
case UNNAMED:
case UPPER:
case USAGE:
case USER:
case USER_DEFINED_TYPE_CATALOG:
case USER_DEFINED_TYPE_CODE:
case USER_DEFINED_TYPE_NAME:
case USER_DEFINED_TYPE_SCHEMA:
case UTF8:
case UTF16:
case UTF32:
case VALUES:
case VAR_POP:
case VAR_SAMP:
case VERSION:
case VIEW:
case WEEK:
case WITH:
case WORK:
case WRAPPER:
case WRITE:
case XML:
case YEAR:
case ZONE:
case IF:
case MATERIALIZED:
case STORED:
case VIRTUAL:
case JAR:
case FILE:
case ARCHIVE:
case UNSIGNED_INTEGER_LITERAL:
case APPROX_NUMERIC_LITERAL:
case DECIMAL_NUMERIC_LITERAL:
case BINARY_STRING_LITERAL:
case QUOTED_STRING:
case PREFIXED_STRING_LITERAL:
case UNICODE_STRING_LITERAL:
case LPAREN:
case LBRACE_D:
case LBRACE_T:
case LBRACE_TS:
case LBRACE_FN:
case HOOK:
case PLUS:
case MINUS:
case BRACKET_QUOTED_IDENTIFIER:
case QUOTED_IDENTIFIER:
case BACK_QUOTED_IDENTIFIER:
case IDENTIFIER:
case UNICODE_QUOTED_IDENTIFIER:
e = OrderedQueryOrExpr(firstExprContext);
break;
default:
jj_la1[17] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
if (e != null) {
if (name != null) {
e = SqlStdOperatorTable.ARGUMENT_ASSIGNMENT.createCall(
Span.of(name, e).pos(), e, name);
}
list.add(e);
}
}
final public void Arg(List list, ExprContext exprContext) throws ParseException {
SqlIdentifier name = null;
SqlNode e = null;
if (jj_2_3(2)) {
name = SimpleIdentifier();
jj_consume_token(NAMED_ARGUMENT_ASSIGNMENT);
} else {
;
}
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case DEFAULT_:
e = Default();
break;
case A:
case ABS:
case ABSENT:
case ABSOLUTE:
case ACTION:
case ADA:
case ADD:
case ADMIN:
case AFTER:
case ALWAYS:
case APPLY:
case ARRAY:
case ASC:
case ASSERTION:
case ASSIGNMENT:
case ATTRIBUTE:
case ATTRIBUTES:
case AVG:
case BEFORE:
case BERNOULLI:
case BREADTH:
case C:
case CARDINALITY:
case CASCADE:
case CASE:
case CAST:
case CATALOG:
case CATALOG_NAME:
case CEIL:
case CEILING:
case CENTURY:
case CHAIN:
case CHAR_LENGTH:
case CHARACTER_LENGTH:
case CHARACTER_SET_CATALOG:
case CHARACTER_SET_NAME:
case CHARACTER_SET_SCHEMA:
case CHARACTERISTICS:
case CHARACTERS:
case CLASSIFIER:
case CLASS_ORIGIN:
case COALESCE:
case COBOL:
case COLLATION:
case COLLATION_CATALOG:
case COLLATION_NAME:
case COLLATION_SCHEMA:
case COLLECT:
case COLUMN_NAME:
case COMMAND_FUNCTION:
case COMMAND_FUNCTION_CODE:
case COMMITTED:
case CONDITIONAL:
case CONDITION_NUMBER:
case CONNECTION:
case CONNECTION_NAME:
case CONSTRAINT_CATALOG:
case CONSTRAINT_NAME:
case CONSTRAINT_SCHEMA:
case CONSTRAINTS:
case CONSTRUCTOR:
case CONTINUE:
case CONVERT:
case COUNT:
case COVAR_POP:
case COVAR_SAMP:
case CUME_DIST:
case CURRENT:
case CURRENT_CATALOG:
case CURRENT_DATE:
case CURRENT_DEFAULT_TRANSFORM_GROUP:
case CURRENT_PATH:
case CURRENT_ROLE:
case CURRENT_SCHEMA:
case CURRENT_TIME:
case CURRENT_TIMESTAMP:
case CURRENT_USER:
case CURSOR:
case CURSOR_NAME:
case DATA:
case DATABASE:
case DATE:
case DATETIME_INTERVAL_CODE:
case DATETIME_INTERVAL_PRECISION:
case DECADE:
case DEFAULTS:
case DEFERRABLE:
case DEFERRED:
case DEFINED:
case DEFINER:
case DEGREE:
case DENSE_RANK:
case DEPTH:
case DERIVED:
case DESC:
case DESCRIPTION:
case DESCRIPTOR:
case DIAGNOSTICS:
case DISPATCH:
case DOMAIN:
case DOW:
case DOY:
case DYNAMIC_FUNCTION:
case DYNAMIC_FUNCTION_CODE:
case ELEMENT:
case ENCODING:
case EPOCH:
case ERROR:
case EXCEPTION:
case EXCLUDE:
case EXCLUDING:
case EXISTS:
case EXP:
case EXTRACT:
case FALSE:
case FINAL:
case FIRST:
case FIRST_VALUE:
case FLOOR:
case FOLLOWING:
case FORMAT:
case FORTRAN:
case FOUND:
case FRAC_SECOND:
case FUSION:
case G:
case GENERAL:
case GENERATED:
case GEOMETRY:
case GO:
case GOTO:
case GRANTED:
case GROUPING:
case HIERARCHY:
case HOUR:
case IGNORE:
case IMMEDIATE:
case IMMEDIATELY:
case IMPLEMENTATION:
case INCLUDING:
case INCREMENT:
case INITIALLY:
case INPUT:
case INSTANCE:
case INSTANTIABLE:
case INTERVAL:
case INVOKER:
case ISODOW:
case ISOYEAR:
case ISOLATION:
case JAVA:
case JSON:
case JSON_ARRAY:
case JSON_ARRAYAGG:
case JSON_EXISTS:
case JSON_OBJECT:
case JSON_OBJECTAGG:
case JSON_QUERY:
case JSON_VALUE:
case K:
case KEY:
case KEY_MEMBER:
case KEY_TYPE:
case LABEL:
case LAG:
case LAST:
case LAST_VALUE:
case LEAD:
case LEFT:
case LENGTH:
case LEVEL:
case LIBRARY:
case LN:
case LOCALTIME:
case LOCALTIMESTAMP:
case LOCATOR:
case LOWER:
case M:
case MAP:
case MATCHED:
case MATCH_NUMBER:
case MAX:
case MAXVALUE:
case MESSAGE_LENGTH:
case MESSAGE_OCTET_LENGTH:
case MESSAGE_TEXT:
case MICROSECOND:
case MILLISECOND:
case MILLENNIUM:
case MIN:
case MINUTE:
case MINVALUE:
case MOD:
case MONTH:
case MORE_:
case MULTISET:
case MUMPS:
case NAME:
case NAMES:
case NANOSECOND:
case NESTING:
case NEW:
case NEXT:
case NORMALIZED:
case NOT:
case NTH_VALUE:
case NTILE:
case NULL:
case NULLABLE:
case NULLIF:
case NULLS:
case NUMBER:
case OBJECT:
case OCTET_LENGTH:
case OCTETS:
case OPTION:
case OPTIONS:
case ORDERING:
case ORDINALITY:
case OTHERS:
case OUTPUT:
case OVERLAY:
case OVERRIDING:
case PAD:
case PARAMETER_MODE:
case PARAMETER_NAME:
case PARAMETER_ORDINAL_POSITION:
case PARAMETER_SPECIFIC_CATALOG:
case PARAMETER_SPECIFIC_NAME:
case PARAMETER_SPECIFIC_SCHEMA:
case PARTIAL:
case PASCAL:
case PASSING:
case PASSTHROUGH:
case PAST:
case PATH:
case PERCENT_RANK:
case PERIOD:
case PLACING:
case PLAN:
case PLI:
case POSITION:
case POWER:
case PRECEDING:
case PRESERVE:
case PREV:
case PRIOR:
case PRIVILEGES:
case PUBLIC:
case QUARTER:
case RANK:
case READ:
case REGR_COUNT:
case REGR_SXX:
case REGR_SYY:
case RELATIVE:
case REPEATABLE:
case REPLACE:
case RESPECT:
case RESTART:
case RESTRICT:
case RETURNED_CARDINALITY:
case RETURNED_LENGTH:
case RETURNED_OCTET_LENGTH:
case RETURNED_SQLSTATE:
case RETURNING:
case RIGHT:
case ROLE:
case ROUTINE:
case ROUTINE_CATALOG:
case ROUTINE_NAME:
case ROUTINE_SCHEMA:
case ROW:
case ROW_COUNT:
case ROW_NUMBER:
case RUNNING:
case SCALAR:
case SCALE:
case SCHEMA:
case SCHEMA_NAME:
case SCOPE_CATALOGS:
case SCOPE_NAME:
case SCOPE_SCHEMA:
case SECOND:
case SECTION:
case SECURITY:
case SELF:
case SEQUENCE:
case SERIALIZABLE:
case SERVER:
case SERVER_NAME:
case SESSION:
case SESSION_USER:
case SETS:
case SIMPLE:
case SIZE:
case SOURCE:
case SPACE:
case SPECIFIC:
case SPECIFIC_NAME:
case SQL_BIGINT:
case SQL_BINARY:
case SQL_BIT:
case SQL_BLOB:
case SQL_BOOLEAN:
case SQL_CHAR:
case SQL_CLOB:
case SQL_DATE:
case SQL_DECIMAL:
case SQL_DOUBLE:
case SQL_FLOAT:
case SQL_INTEGER:
case SQL_INTERVAL_DAY:
case SQL_INTERVAL_DAY_TO_HOUR:
case SQL_INTERVAL_DAY_TO_MINUTE:
case SQL_INTERVAL_DAY_TO_SECOND:
case SQL_INTERVAL_HOUR:
case SQL_INTERVAL_HOUR_TO_MINUTE:
case SQL_INTERVAL_HOUR_TO_SECOND:
case SQL_INTERVAL_MINUTE:
case SQL_INTERVAL_MINUTE_TO_SECOND:
case SQL_INTERVAL_MONTH:
case SQL_INTERVAL_SECOND:
case SQL_INTERVAL_YEAR:
case SQL_INTERVAL_YEAR_TO_MONTH:
case SQL_LONGVARBINARY:
case SQL_LONGVARCHAR:
case SQL_LONGVARNCHAR:
case SQL_NCHAR:
case SQL_NCLOB:
case SQL_NUMERIC:
case SQL_NVARCHAR:
case SQL_REAL:
case SQL_SMALLINT:
case SQL_TIME:
case SQL_TIMESTAMP:
case SQL_TINYINT:
case SQL_TSI_DAY:
case SQL_TSI_FRAC_SECOND:
case SQL_TSI_HOUR:
case SQL_TSI_MICROSECOND:
case SQL_TSI_MINUTE:
case SQL_TSI_MONTH:
case SQL_TSI_QUARTER:
case SQL_TSI_SECOND:
case SQL_TSI_WEEK:
case SQL_TSI_YEAR:
case SQL_VARBINARY:
case SQL_VARCHAR:
case SQRT:
case STATE:
case STATEMENT:
case STDDEV_POP:
case STDDEV_SAMP:
case STRUCTURE:
case STYLE:
case SUBCLASS_ORIGIN:
case SUBSTITUTE:
case SUBSTRING:
case SUM:
case SYSTEM_USER:
case TABLE_NAME:
case TEMPORARY:
case TIES:
case TIME:
case TIMESTAMP:
case TIMESTAMPADD:
case TIMESTAMPDIFF:
case TOP_LEVEL_COUNT:
case TRANSACTION:
case TRANSACTIONS_ACTIVE:
case TRANSACTIONS_COMMITTED:
case TRANSACTIONS_ROLLED_BACK:
case TRANSFORM:
case TRANSFORMS:
case TRANSLATE:
case TRIGGER_CATALOG:
case TRIGGER_NAME:
case TRIGGER_SCHEMA:
case TRIM:
case TRUE:
case TRUNCATE:
case TYPE:
case UNBOUNDED:
case UNCOMMITTED:
case UNCONDITIONAL:
case UNDER:
case UNKNOWN:
case UNNAMED:
case UPPER:
case USAGE:
case USER:
case USER_DEFINED_TYPE_CATALOG:
case USER_DEFINED_TYPE_CODE:
case USER_DEFINED_TYPE_NAME:
case USER_DEFINED_TYPE_SCHEMA:
case UTF8:
case UTF16:
case UTF32:
case VAR_POP:
case VAR_SAMP:
case VERSION:
case VIEW:
case WEEK:
case WORK:
case WRAPPER:
case WRITE:
case XML:
case YEAR:
case ZONE:
case IF:
case MATERIALIZED:
case STORED:
case VIRTUAL:
case JAR:
case FILE:
case ARCHIVE:
case UNSIGNED_INTEGER_LITERAL:
case APPROX_NUMERIC_LITERAL:
case DECIMAL_NUMERIC_LITERAL:
case BINARY_STRING_LITERAL:
case QUOTED_STRING:
case PREFIXED_STRING_LITERAL:
case UNICODE_STRING_LITERAL:
case LPAREN:
case LBRACE_D:
case LBRACE_T:
case LBRACE_TS:
case LBRACE_FN:
case HOOK:
case PLUS:
case MINUS:
case BRACKET_QUOTED_IDENTIFIER:
case QUOTED_IDENTIFIER:
case BACK_QUOTED_IDENTIFIER:
case IDENTIFIER:
case UNICODE_QUOTED_IDENTIFIER:
e = Expression(exprContext);
break;
default:
jj_la1[18] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
if (e != null) {
if (name != null) {
e = SqlStdOperatorTable.ARGUMENT_ASSIGNMENT.createCall(
Span.of(name, e).pos(), e, name);
}
list.add(e);
}
}
final public SqlNode Default() throws ParseException {
jj_consume_token(DEFAULT_);
{if (true) return SqlStdOperatorTable.DEFAULT.createCall(getPos());}
throw new Error("Missing return statement in function");
}
/**
* Parses a query (SELECT, UNION, INTERSECT, EXCEPT, VALUES, TABLE) followed by
* the end-of-file symbol.
*/
final public SqlNode SqlQueryEof() throws ParseException {
SqlNode query;
query = OrderedQueryOrExpr(ExprContext.ACCEPT_QUERY);
jj_consume_token(0);
{if (true) return query;}
throw new Error("Missing return statement in function");
}
/**
* Parses a list of SQL statements separated by semicolon.
* The semicolon is required between statements, but is
* optional at the end.
*/
final public SqlNodeList SqlStmtList() throws ParseException {
final List stmtList = new ArrayList();
SqlNode stmt;
stmt = SqlStmt();
stmtList.add(stmt);
label_4:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case SEMICOLON:
;
break;
default:
jj_la1[19] = jj_gen;
break label_4;
}
jj_consume_token(SEMICOLON);
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case A:
case ABS:
case ABSENT:
case ABSOLUTE:
case ACTION:
case ADA:
case ADD:
case ADMIN:
case AFTER:
case ALTER:
case ALWAYS:
case APPLY:
case ARRAY:
case ASC:
case ASSERTION:
case ASSIGNMENT:
case ATTRIBUTE:
case ATTRIBUTES:
case AVG:
case BEFORE:
case BERNOULLI:
case BREADTH:
case C:
case CALL:
case CARDINALITY:
case CASCADE:
case CASE:
case CAST:
case CATALOG:
case CATALOG_NAME:
case CEIL:
case CEILING:
case CENTURY:
case CHAIN:
case CHAR_LENGTH:
case CHARACTER_LENGTH:
case CHARACTER_SET_CATALOG:
case CHARACTER_SET_NAME:
case CHARACTER_SET_SCHEMA:
case CHARACTERISTICS:
case CHARACTERS:
case CLASSIFIER:
case CLASS_ORIGIN:
case COALESCE:
case COBOL:
case COLLATION:
case COLLATION_CATALOG:
case COLLATION_NAME:
case COLLATION_SCHEMA:
case COLLECT:
case COLUMN_NAME:
case COMMAND_FUNCTION:
case COMMAND_FUNCTION_CODE:
case COMMITTED:
case CONDITIONAL:
case CONDITION_NUMBER:
case CONNECTION:
case CONNECTION_NAME:
case CONSTRAINT_CATALOG:
case CONSTRAINT_NAME:
case CONSTRAINT_SCHEMA:
case CONSTRAINTS:
case CONSTRUCTOR:
case CONTINUE:
case CONVERT:
case COUNT:
case COVAR_POP:
case COVAR_SAMP:
case CREATE:
case CUME_DIST:
case CURRENT:
case CURRENT_CATALOG:
case CURRENT_DATE:
case CURRENT_DEFAULT_TRANSFORM_GROUP:
case CURRENT_PATH:
case CURRENT_ROLE:
case CURRENT_SCHEMA:
case CURRENT_TIME:
case CURRENT_TIMESTAMP:
case CURRENT_USER:
case CURSOR:
case CURSOR_NAME:
case DATA:
case DATABASE:
case DATE:
case DATETIME_INTERVAL_CODE:
case DATETIME_INTERVAL_PRECISION:
case DECADE:
case DEFAULTS:
case DEFERRABLE:
case DEFERRED:
case DEFINED:
case DEFINER:
case DEGREE:
case DELETE:
case DENSE_RANK:
case DEPTH:
case DERIVED:
case DESC:
case DESCRIBE:
case DESCRIPTION:
case DESCRIPTOR:
case DIAGNOSTICS:
case DISPATCH:
case DOMAIN:
case DOW:
case DOY:
case DROP:
case DYNAMIC_FUNCTION:
case DYNAMIC_FUNCTION_CODE:
case ELEMENT:
case ENCODING:
case EPOCH:
case ERROR:
case EXCEPTION:
case EXCLUDE:
case EXCLUDING:
case EXISTS:
case EXP:
case EXPLAIN:
case EXTRACT:
case FALSE:
case FINAL:
case FIRST:
case FIRST_VALUE:
case FLOOR:
case FOLLOWING:
case FORMAT:
case FORTRAN:
case FOUND:
case FRAC_SECOND:
case FUSION:
case G:
case GENERAL:
case GENERATED:
case GEOMETRY:
case GO:
case GOTO:
case GRANTED:
case GROUPING:
case HIERARCHY:
case HOUR:
case IGNORE:
case IMMEDIATE:
case IMMEDIATELY:
case IMPLEMENTATION:
case INCLUDING:
case INCREMENT:
case INITIALLY:
case INPUT:
case INSERT:
case INSTANCE:
case INSTANTIABLE:
case INTERVAL:
case INVOKER:
case ISODOW:
case ISOYEAR:
case ISOLATION:
case JAVA:
case JSON:
case JSON_ARRAY:
case JSON_ARRAYAGG:
case JSON_EXISTS:
case JSON_OBJECT:
case JSON_OBJECTAGG:
case JSON_QUERY:
case JSON_VALUE:
case K:
case KEY:
case KEY_MEMBER:
case KEY_TYPE:
case LABEL:
case LAG:
case LAST:
case LAST_VALUE:
case LEAD:
case LEFT:
case LENGTH:
case LEVEL:
case LIBRARY:
case LN:
case LOCALTIME:
case LOCALTIMESTAMP:
case LOCATOR:
case LOWER:
case M:
case MAP:
case MATCHED:
case MATCH_NUMBER:
case MAX:
case MAXVALUE:
case MERGE:
case MESSAGE_LENGTH:
case MESSAGE_OCTET_LENGTH:
case MESSAGE_TEXT:
case MICROSECOND:
case MILLISECOND:
case MILLENNIUM:
case MIN:
case MINUTE:
case MINVALUE:
case MOD:
case MONTH:
case MORE_:
case MULTISET:
case MUMPS:
case NAME:
case NAMES:
case NANOSECOND:
case NESTING:
case NEW:
case NEXT:
case NORMALIZED:
case NOT:
case NTH_VALUE:
case NTILE:
case NULL:
case NULLABLE:
case NULLIF:
case NULLS:
case NUMBER:
case OBJECT:
case OCTET_LENGTH:
case OCTETS:
case OPTION:
case OPTIONS:
case ORDERING:
case ORDINALITY:
case OTHERS:
case OUTPUT:
case OVERLAY:
case OVERRIDING:
case PAD:
case PARAMETER_MODE:
case PARAMETER_NAME:
case PARAMETER_ORDINAL_POSITION:
case PARAMETER_SPECIFIC_CATALOG:
case PARAMETER_SPECIFIC_NAME:
case PARAMETER_SPECIFIC_SCHEMA:
case PARTIAL:
case PASCAL:
case PASSING:
case PASSTHROUGH:
case PAST:
case PATH:
case PERCENT_RANK:
case PERIOD:
case PLACING:
case PLAN:
case PLI:
case POSITION:
case POWER:
case PRECEDING:
case PRESERVE:
case PREV:
case PRIOR:
case PRIVILEGES:
case PUBLIC:
case QUARTER:
case RANK:
case READ:
case REGR_COUNT:
case REGR_SXX:
case REGR_SYY:
case RELATIVE:
case REPEATABLE:
case REPLACE:
case RESET:
case RESPECT:
case RESTART:
case RESTRICT:
case RETURNED_CARDINALITY:
case RETURNED_LENGTH:
case RETURNED_OCTET_LENGTH:
case RETURNED_SQLSTATE:
case RETURNING:
case RIGHT:
case ROLE:
case ROUTINE:
case ROUTINE_CATALOG:
case ROUTINE_NAME:
case ROUTINE_SCHEMA:
case ROW:
case ROW_COUNT:
case ROW_NUMBER:
case RUNNING:
case SCALAR:
case SCALE:
case SCHEMA:
case SCHEMA_NAME:
case SCOPE_CATALOGS:
case SCOPE_NAME:
case SCOPE_SCHEMA:
case SECOND:
case SECTION:
case SECURITY:
case SELECT:
case SELF:
case SEQUENCE:
case SERIALIZABLE:
case SERVER:
case SERVER_NAME:
case SESSION:
case SESSION_USER:
case SET:
case SETS:
case SIMPLE:
case SIZE:
case SOURCE:
case SPACE:
case SPECIFIC:
case SPECIFIC_NAME:
case SQL_BIGINT:
case SQL_BINARY:
case SQL_BIT:
case SQL_BLOB:
case SQL_BOOLEAN:
case SQL_CHAR:
case SQL_CLOB:
case SQL_DATE:
case SQL_DECIMAL:
case SQL_DOUBLE:
case SQL_FLOAT:
case SQL_INTEGER:
case SQL_INTERVAL_DAY:
case SQL_INTERVAL_DAY_TO_HOUR:
case SQL_INTERVAL_DAY_TO_MINUTE:
case SQL_INTERVAL_DAY_TO_SECOND:
case SQL_INTERVAL_HOUR:
case SQL_INTERVAL_HOUR_TO_MINUTE:
case SQL_INTERVAL_HOUR_TO_SECOND:
case SQL_INTERVAL_MINUTE:
case SQL_INTERVAL_MINUTE_TO_SECOND:
case SQL_INTERVAL_MONTH:
case SQL_INTERVAL_SECOND:
case SQL_INTERVAL_YEAR:
case SQL_INTERVAL_YEAR_TO_MONTH:
case SQL_LONGVARBINARY:
case SQL_LONGVARCHAR:
case SQL_LONGVARNCHAR:
case SQL_NCHAR:
case SQL_NCLOB:
case SQL_NUMERIC:
case SQL_NVARCHAR:
case SQL_REAL:
case SQL_SMALLINT:
case SQL_TIME:
case SQL_TIMESTAMP:
case SQL_TINYINT:
case SQL_TSI_DAY:
case SQL_TSI_FRAC_SECOND:
case SQL_TSI_HOUR:
case SQL_TSI_MICROSECOND:
case SQL_TSI_MINUTE:
case SQL_TSI_MONTH:
case SQL_TSI_QUARTER:
case SQL_TSI_SECOND:
case SQL_TSI_WEEK:
case SQL_TSI_YEAR:
case SQL_VARBINARY:
case SQL_VARCHAR:
case SQRT:
case STATE:
case STATEMENT:
case STDDEV_POP:
case STDDEV_SAMP:
case STRUCTURE:
case STYLE:
case SUBCLASS_ORIGIN:
case SUBSTITUTE:
case SUBSTRING:
case SUM:
case SYSTEM_USER:
case TABLE:
case TABLE_NAME:
case TEMPORARY:
case TIES:
case TIME:
case TIMESTAMP:
case TIMESTAMPADD:
case TIMESTAMPDIFF:
case TOP_LEVEL_COUNT:
case TRANSACTION:
case TRANSACTIONS_ACTIVE:
case TRANSACTIONS_COMMITTED:
case TRANSACTIONS_ROLLED_BACK:
case TRANSFORM:
case TRANSFORMS:
case TRANSLATE:
case TRIGGER_CATALOG:
case TRIGGER_NAME:
case TRIGGER_SCHEMA:
case TRIM:
case TRUE:
case TRUNCATE:
case TYPE:
case UNBOUNDED:
case UNCOMMITTED:
case UNCONDITIONAL:
case UNDER:
case UNKNOWN:
case UNNAMED:
case UPDATE:
case UPPER:
case UPSERT:
case USAGE:
case USER:
case USER_DEFINED_TYPE_CATALOG:
case USER_DEFINED_TYPE_CODE:
case USER_DEFINED_TYPE_NAME:
case USER_DEFINED_TYPE_SCHEMA:
case UTF8:
case UTF16:
case UTF32:
case VALUES:
case VAR_POP:
case VAR_SAMP:
case VERSION:
case VIEW:
case WEEK:
case WITH:
case WORK:
case WRAPPER:
case WRITE:
case XML:
case YEAR:
case ZONE:
case IF:
case MATERIALIZED:
case STORED:
case VIRTUAL:
case JAR:
case FILE:
case ARCHIVE:
case UNSIGNED_INTEGER_LITERAL:
case APPROX_NUMERIC_LITERAL:
case DECIMAL_NUMERIC_LITERAL:
case BINARY_STRING_LITERAL:
case QUOTED_STRING:
case PREFIXED_STRING_LITERAL:
case UNICODE_STRING_LITERAL:
case LPAREN:
case LBRACE_D:
case LBRACE_T:
case LBRACE_TS:
case LBRACE_FN:
case HOOK:
case PLUS:
case MINUS:
case BRACKET_QUOTED_IDENTIFIER:
case QUOTED_IDENTIFIER:
case BACK_QUOTED_IDENTIFIER:
case IDENTIFIER:
case UNICODE_QUOTED_IDENTIFIER:
stmt = SqlStmt();
stmtList.add(stmt);
break;
default:
jj_la1[20] = jj_gen;
;
}
}
jj_consume_token(0);
{if (true) return new SqlNodeList(stmtList, Span.of(stmtList).pos());}
throw new Error("Missing return statement in function");
}
/**
* Parses an SQL statement.
*/
final public SqlNode SqlStmt() throws ParseException {
SqlNode stmt;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case RESET:
case SET:
stmt = SqlSetOption(Span.of(), null);
break;
case ALTER:
stmt = SqlAlter();
break;
case CREATE:
stmt = SqlCreate();
break;
case DROP:
stmt = SqlDrop();
break;
case A:
case ABS:
case ABSENT:
case ABSOLUTE:
case ACTION:
case ADA:
case ADD:
case ADMIN:
case AFTER:
case ALWAYS:
case APPLY:
case ARRAY:
case ASC:
case ASSERTION:
case ASSIGNMENT:
case ATTRIBUTE:
case ATTRIBUTES:
case AVG:
case BEFORE:
case BERNOULLI:
case BREADTH:
case C:
case CARDINALITY:
case CASCADE:
case CASE:
case CAST:
case CATALOG:
case CATALOG_NAME:
case CEIL:
case CEILING:
case CENTURY:
case CHAIN:
case CHAR_LENGTH:
case CHARACTER_LENGTH:
case CHARACTER_SET_CATALOG:
case CHARACTER_SET_NAME:
case CHARACTER_SET_SCHEMA:
case CHARACTERISTICS:
case CHARACTERS:
case CLASSIFIER:
case CLASS_ORIGIN:
case COALESCE:
case COBOL:
case COLLATION:
case COLLATION_CATALOG:
case COLLATION_NAME:
case COLLATION_SCHEMA:
case COLLECT:
case COLUMN_NAME:
case COMMAND_FUNCTION:
case COMMAND_FUNCTION_CODE:
case COMMITTED:
case CONDITIONAL:
case CONDITION_NUMBER:
case CONNECTION:
case CONNECTION_NAME:
case CONSTRAINT_CATALOG:
case CONSTRAINT_NAME:
case CONSTRAINT_SCHEMA:
case CONSTRAINTS:
case CONSTRUCTOR:
case CONTINUE:
case CONVERT:
case COUNT:
case COVAR_POP:
case COVAR_SAMP:
case CUME_DIST:
case CURRENT:
case CURRENT_CATALOG:
case CURRENT_DATE:
case CURRENT_DEFAULT_TRANSFORM_GROUP:
case CURRENT_PATH:
case CURRENT_ROLE:
case CURRENT_SCHEMA:
case CURRENT_TIME:
case CURRENT_TIMESTAMP:
case CURRENT_USER:
case CURSOR:
case CURSOR_NAME:
case DATA:
case DATABASE:
case DATE:
case DATETIME_INTERVAL_CODE:
case DATETIME_INTERVAL_PRECISION:
case DECADE:
case DEFAULTS:
case DEFERRABLE:
case DEFERRED:
case DEFINED:
case DEFINER:
case DEGREE:
case DENSE_RANK:
case DEPTH:
case DERIVED:
case DESC:
case DESCRIPTION:
case DESCRIPTOR:
case DIAGNOSTICS:
case DISPATCH:
case DOMAIN:
case DOW:
case DOY:
case DYNAMIC_FUNCTION:
case DYNAMIC_FUNCTION_CODE:
case ELEMENT:
case ENCODING:
case EPOCH:
case ERROR:
case EXCEPTION:
case EXCLUDE:
case EXCLUDING:
case EXISTS:
case EXP:
case EXTRACT:
case FALSE:
case FINAL:
case FIRST:
case FIRST_VALUE:
case FLOOR:
case FOLLOWING:
case FORMAT:
case FORTRAN:
case FOUND:
case FRAC_SECOND:
case FUSION:
case G:
case GENERAL:
case GENERATED:
case GEOMETRY:
case GO:
case GOTO:
case GRANTED:
case GROUPING:
case HIERARCHY:
case HOUR:
case IGNORE:
case IMMEDIATE:
case IMMEDIATELY:
case IMPLEMENTATION:
case INCLUDING:
case INCREMENT:
case INITIALLY:
case INPUT:
case INSTANCE:
case INSTANTIABLE:
case INTERVAL:
case INVOKER:
case ISODOW:
case ISOYEAR:
case ISOLATION:
case JAVA:
case JSON:
case JSON_ARRAY:
case JSON_ARRAYAGG:
case JSON_EXISTS:
case JSON_OBJECT:
case JSON_OBJECTAGG:
case JSON_QUERY:
case JSON_VALUE:
case K:
case KEY:
case KEY_MEMBER:
case KEY_TYPE:
case LABEL:
case LAG:
case LAST:
case LAST_VALUE:
case LEAD:
case LEFT:
case LENGTH:
case LEVEL:
case LIBRARY:
case LN:
case LOCALTIME:
case LOCALTIMESTAMP:
case LOCATOR:
case LOWER:
case M:
case MAP:
case MATCHED:
case MATCH_NUMBER:
case MAX:
case MAXVALUE:
case MESSAGE_LENGTH:
case MESSAGE_OCTET_LENGTH:
case MESSAGE_TEXT:
case MICROSECOND:
case MILLISECOND:
case MILLENNIUM:
case MIN:
case MINUTE:
case MINVALUE:
case MOD:
case MONTH:
case MORE_:
case MULTISET:
case MUMPS:
case NAME:
case NAMES:
case NANOSECOND:
case NESTING:
case NEW:
case NEXT:
case NORMALIZED:
case NOT:
case NTH_VALUE:
case NTILE:
case NULL:
case NULLABLE:
case NULLIF:
case NULLS:
case NUMBER:
case OBJECT:
case OCTET_LENGTH:
case OCTETS:
case OPTION:
case OPTIONS:
case ORDERING:
case ORDINALITY:
case OTHERS:
case OUTPUT:
case OVERLAY:
case OVERRIDING:
case PAD:
case PARAMETER_MODE:
case PARAMETER_NAME:
case PARAMETER_ORDINAL_POSITION:
case PARAMETER_SPECIFIC_CATALOG:
case PARAMETER_SPECIFIC_NAME:
case PARAMETER_SPECIFIC_SCHEMA:
case PARTIAL:
case PASCAL:
case PASSING:
case PASSTHROUGH:
case PAST:
case PATH:
case PERCENT_RANK:
case PERIOD:
case PLACING:
case PLAN:
case PLI:
case POSITION:
case POWER:
case PRECEDING:
case PRESERVE:
case PREV:
case PRIOR:
case PRIVILEGES:
case PUBLIC:
case QUARTER:
case RANK:
case READ:
case REGR_COUNT:
case REGR_SXX:
case REGR_SYY:
case RELATIVE:
case REPEATABLE:
case REPLACE:
case RESPECT:
case RESTART:
case RESTRICT:
case RETURNED_CARDINALITY:
case RETURNED_LENGTH:
case RETURNED_OCTET_LENGTH:
case RETURNED_SQLSTATE:
case RETURNING:
case RIGHT:
case ROLE:
case ROUTINE:
case ROUTINE_CATALOG:
case ROUTINE_NAME:
case ROUTINE_SCHEMA:
case ROW:
case ROW_COUNT:
case ROW_NUMBER:
case RUNNING:
case SCALAR:
case SCALE:
case SCHEMA:
case SCHEMA_NAME:
case SCOPE_CATALOGS:
case SCOPE_NAME:
case SCOPE_SCHEMA:
case SECOND:
case SECTION:
case SECURITY:
case SELECT:
case SELF:
case SEQUENCE:
case SERIALIZABLE:
case SERVER:
case SERVER_NAME:
case SESSION:
case SESSION_USER:
case SETS:
case SIMPLE:
case SIZE:
case SOURCE:
case SPACE:
case SPECIFIC:
case SPECIFIC_NAME:
case SQL_BIGINT:
case SQL_BINARY:
case SQL_BIT:
case SQL_BLOB:
case SQL_BOOLEAN:
case SQL_CHAR:
case SQL_CLOB:
case SQL_DATE:
case SQL_DECIMAL:
case SQL_DOUBLE:
case SQL_FLOAT:
case SQL_INTEGER:
case SQL_INTERVAL_DAY:
case SQL_INTERVAL_DAY_TO_HOUR:
case SQL_INTERVAL_DAY_TO_MINUTE:
case SQL_INTERVAL_DAY_TO_SECOND:
case SQL_INTERVAL_HOUR:
case SQL_INTERVAL_HOUR_TO_MINUTE:
case SQL_INTERVAL_HOUR_TO_SECOND:
case SQL_INTERVAL_MINUTE:
case SQL_INTERVAL_MINUTE_TO_SECOND:
case SQL_INTERVAL_MONTH:
case SQL_INTERVAL_SECOND:
case SQL_INTERVAL_YEAR:
case SQL_INTERVAL_YEAR_TO_MONTH:
case SQL_LONGVARBINARY:
case SQL_LONGVARCHAR:
case SQL_LONGVARNCHAR:
case SQL_NCHAR:
case SQL_NCLOB:
case SQL_NUMERIC:
case SQL_NVARCHAR:
case SQL_REAL:
case SQL_SMALLINT:
case SQL_TIME:
case SQL_TIMESTAMP:
case SQL_TINYINT:
case SQL_TSI_DAY:
case SQL_TSI_FRAC_SECOND:
case SQL_TSI_HOUR:
case SQL_TSI_MICROSECOND:
case SQL_TSI_MINUTE:
case SQL_TSI_MONTH:
case SQL_TSI_QUARTER:
case SQL_TSI_SECOND:
case SQL_TSI_WEEK:
case SQL_TSI_YEAR:
case SQL_VARBINARY:
case SQL_VARCHAR:
case SQRT:
case STATE:
case STATEMENT:
case STDDEV_POP:
case STDDEV_SAMP:
case STRUCTURE:
case STYLE:
case SUBCLASS_ORIGIN:
case SUBSTITUTE:
case SUBSTRING:
case SUM:
case SYSTEM_USER:
case TABLE:
case TABLE_NAME:
case TEMPORARY:
case TIES:
case TIME:
case TIMESTAMP:
case TIMESTAMPADD:
case TIMESTAMPDIFF:
case TOP_LEVEL_COUNT:
case TRANSACTION:
case TRANSACTIONS_ACTIVE:
case TRANSACTIONS_COMMITTED:
case TRANSACTIONS_ROLLED_BACK:
case TRANSFORM:
case TRANSFORMS:
case TRANSLATE:
case TRIGGER_CATALOG:
case TRIGGER_NAME:
case TRIGGER_SCHEMA:
case TRIM:
case TRUE:
case TRUNCATE:
case TYPE:
case UNBOUNDED:
case UNCOMMITTED:
case UNCONDITIONAL:
case UNDER:
case UNKNOWN:
case UNNAMED:
case UPPER:
case USAGE:
case USER:
case USER_DEFINED_TYPE_CATALOG:
case USER_DEFINED_TYPE_CODE:
case USER_DEFINED_TYPE_NAME:
case USER_DEFINED_TYPE_SCHEMA:
case UTF8:
case UTF16:
case UTF32:
case VALUES:
case VAR_POP:
case VAR_SAMP:
case VERSION:
case VIEW:
case WEEK:
case WITH:
case WORK:
case WRAPPER:
case WRITE:
case XML:
case YEAR:
case ZONE:
case IF:
case MATERIALIZED:
case STORED:
case VIRTUAL:
case JAR:
case FILE:
case ARCHIVE:
case UNSIGNED_INTEGER_LITERAL:
case APPROX_NUMERIC_LITERAL:
case DECIMAL_NUMERIC_LITERAL:
case BINARY_STRING_LITERAL:
case QUOTED_STRING:
case PREFIXED_STRING_LITERAL:
case UNICODE_STRING_LITERAL:
case LPAREN:
case LBRACE_D:
case LBRACE_T:
case LBRACE_TS:
case LBRACE_FN:
case HOOK:
case PLUS:
case MINUS:
case BRACKET_QUOTED_IDENTIFIER:
case QUOTED_IDENTIFIER:
case BACK_QUOTED_IDENTIFIER:
case IDENTIFIER:
case UNICODE_QUOTED_IDENTIFIER:
stmt = OrderedQueryOrExpr(ExprContext.ACCEPT_QUERY);
break;
case EXPLAIN:
stmt = SqlExplain();
break;
case DESCRIBE:
stmt = SqlDescribe();
break;
case INSERT:
case UPSERT:
stmt = SqlInsert();
break;
case DELETE:
stmt = SqlDelete();
break;
case UPDATE:
stmt = SqlUpdate();
break;
case MERGE:
stmt = SqlMerge();
break;
case CALL:
stmt = SqlProcedureCall();
break;
default:
jj_la1[21] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
{if (true) return stmt;}
throw new Error("Missing return statement in function");
}
/**
* Parses an SQL statement followed by the end-of-file symbol.
*/
final public SqlNode SqlStmtEof() throws ParseException {
SqlNode stmt;
stmt = SqlStmt();
jj_consume_token(0);
{if (true) return stmt;}
throw new Error("Missing return statement in function");
}
final public boolean IfNotExistsOpt() throws ParseException {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case IF:
jj_consume_token(IF);
jj_consume_token(NOT);
jj_consume_token(EXISTS);
{if (true) return true;}
break;
default:
jj_la1[22] = jj_gen;
{if (true) return false;}
}
throw new Error("Missing return statement in function");
}
final public boolean IfExistsOpt() throws ParseException {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case IF:
jj_consume_token(IF);
jj_consume_token(EXISTS);
{if (true) return true;}
break;
default:
jj_la1[23] = jj_gen;
{if (true) return false;}
}
throw new Error("Missing return statement in function");
}
final public SqlCreate SqlCreateSchema(Span s, boolean replace) throws ParseException {
final boolean ifNotExists;
final SqlIdentifier id;
jj_consume_token(SCHEMA);
ifNotExists = IfNotExistsOpt();
id = CompoundIdentifier();
{if (true) return SqlDdlNodes.createSchema(s.end(this), replace, ifNotExists, id);}
throw new Error("Missing return statement in function");
}
final public SqlCreate SqlCreateForeignSchema(Span s, boolean replace) throws ParseException {
final boolean ifNotExists;
final SqlIdentifier id;
SqlNode type = null;
SqlNode library = null;
SqlNodeList optionList = null;
jj_consume_token(FOREIGN);
jj_consume_token(SCHEMA);
ifNotExists = IfNotExistsOpt();
id = CompoundIdentifier();
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case TYPE:
jj_consume_token(TYPE);
type = StringLiteral();
break;
case LIBRARY:
jj_consume_token(LIBRARY);
library = StringLiteral();
break;
default:
jj_la1[24] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case OPTIONS:
optionList = Options();
break;
default:
jj_la1[25] = jj_gen;
;
}
{if (true) return SqlDdlNodes.createForeignSchema(s.end(this), replace,
ifNotExists, id, type, library, optionList);}
throw new Error("Missing return statement in function");
}
final public SqlNodeList Options() throws ParseException {
final Span s;
final List list = new ArrayList();
jj_consume_token(OPTIONS);
s = span();
jj_consume_token(LPAREN);
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case A:
case ABSENT:
case ABSOLUTE:
case ACTION:
case ADA:
case ADD:
case ADMIN:
case AFTER:
case ALWAYS:
case APPLY:
case ASC:
case ASSERTION:
case ASSIGNMENT:
case ATTRIBUTE:
case ATTRIBUTES:
case BEFORE:
case BERNOULLI:
case BREADTH:
case C:
case CASCADE:
case CATALOG:
case CATALOG_NAME:
case CENTURY:
case CHAIN:
case CHARACTER_SET_CATALOG:
case CHARACTER_SET_NAME:
case CHARACTER_SET_SCHEMA:
case CHARACTERISTICS:
case CHARACTERS:
case CLASS_ORIGIN:
case COBOL:
case COLLATION:
case COLLATION_CATALOG:
case COLLATION_NAME:
case COLLATION_SCHEMA:
case COLUMN_NAME:
case COMMAND_FUNCTION:
case COMMAND_FUNCTION_CODE:
case COMMITTED:
case CONDITIONAL:
case CONDITION_NUMBER:
case CONNECTION:
case CONNECTION_NAME:
case CONSTRAINT_CATALOG:
case CONSTRAINT_NAME:
case CONSTRAINT_SCHEMA:
case CONSTRAINTS:
case CONSTRUCTOR:
case CONTINUE:
case CURSOR_NAME:
case DATA:
case DATABASE:
case DATETIME_INTERVAL_CODE:
case DATETIME_INTERVAL_PRECISION:
case DECADE:
case DEFAULTS:
case DEFERRABLE:
case DEFERRED:
case DEFINED:
case DEFINER:
case DEGREE:
case DEPTH:
case DERIVED:
case DESC:
case DESCRIPTION:
case DESCRIPTOR:
case DIAGNOSTICS:
case DISPATCH:
case DOMAIN:
case DOW:
case DOY:
case DYNAMIC_FUNCTION:
case DYNAMIC_FUNCTION_CODE:
case ENCODING:
case EPOCH:
case ERROR:
case EXCEPTION:
case EXCLUDE:
case EXCLUDING:
case FINAL:
case FIRST:
case FOLLOWING:
case FORMAT:
case FORTRAN:
case FOUND:
case FRAC_SECOND:
case G:
case GENERAL:
case GENERATED:
case GEOMETRY:
case GO:
case GOTO:
case GRANTED:
case HIERARCHY:
case IGNORE:
case IMMEDIATE:
case IMMEDIATELY:
case IMPLEMENTATION:
case INCLUDING:
case INCREMENT:
case INITIALLY:
case INPUT:
case INSTANCE:
case INSTANTIABLE:
case INVOKER:
case ISODOW:
case ISOYEAR:
case ISOLATION:
case JAVA:
case JSON:
case K:
case KEY:
case KEY_MEMBER:
case KEY_TYPE:
case LABEL:
case LAST:
case LENGTH:
case LEVEL:
case LIBRARY:
case LOCATOR:
case M:
case MAP:
case MATCHED:
case MAXVALUE:
case MESSAGE_LENGTH:
case MESSAGE_OCTET_LENGTH:
case MESSAGE_TEXT:
case MICROSECOND:
case MILLISECOND:
case MILLENNIUM:
case MINVALUE:
case MORE_:
case MUMPS:
case NAME:
case NAMES:
case NANOSECOND:
case NESTING:
case NORMALIZED:
case NULLABLE:
case NULLS:
case NUMBER:
case OBJECT:
case OCTETS:
case OPTION:
case OPTIONS:
case ORDERING:
case ORDINALITY:
case OTHERS:
case OUTPUT:
case OVERRIDING:
case PAD:
case PARAMETER_MODE:
case PARAMETER_NAME:
case PARAMETER_ORDINAL_POSITION:
case PARAMETER_SPECIFIC_CATALOG:
case PARAMETER_SPECIFIC_NAME:
case PARAMETER_SPECIFIC_SCHEMA:
case PARTIAL:
case PASCAL:
case PASSING:
case PASSTHROUGH:
case PAST:
case PATH:
case PLACING:
case PLAN:
case PLI:
case PRECEDING:
case PRESERVE:
case PRIOR:
case PRIVILEGES:
case PUBLIC:
case QUARTER:
case READ:
case RELATIVE:
case REPEATABLE:
case REPLACE:
case RESPECT:
case RESTART:
case RESTRICT:
case RETURNED_CARDINALITY:
case RETURNED_LENGTH:
case RETURNED_OCTET_LENGTH:
case RETURNED_SQLSTATE:
case RETURNING:
case ROLE:
case ROUTINE:
case ROUTINE_CATALOG:
case ROUTINE_NAME:
case ROUTINE_SCHEMA:
case ROW_COUNT:
case SCALAR:
case SCALE:
case SCHEMA:
case SCHEMA_NAME:
case SCOPE_CATALOGS:
case SCOPE_NAME:
case SCOPE_SCHEMA:
case SECTION:
case SECURITY:
case SELF:
case SEQUENCE:
case SERIALIZABLE:
case SERVER:
case SERVER_NAME:
case SESSION:
case SETS:
case SIMPLE:
case SIZE:
case SOURCE:
case SPACE:
case SPECIFIC_NAME:
case SQL_BIGINT:
case SQL_BINARY:
case SQL_BIT:
case SQL_BLOB:
case SQL_BOOLEAN:
case SQL_CHAR:
case SQL_CLOB:
case SQL_DATE:
case SQL_DECIMAL:
case SQL_DOUBLE:
case SQL_FLOAT:
case SQL_INTEGER:
case SQL_INTERVAL_DAY:
case SQL_INTERVAL_DAY_TO_HOUR:
case SQL_INTERVAL_DAY_TO_MINUTE:
case SQL_INTERVAL_DAY_TO_SECOND:
case SQL_INTERVAL_HOUR:
case SQL_INTERVAL_HOUR_TO_MINUTE:
case SQL_INTERVAL_HOUR_TO_SECOND:
case SQL_INTERVAL_MINUTE:
case SQL_INTERVAL_MINUTE_TO_SECOND:
case SQL_INTERVAL_MONTH:
case SQL_INTERVAL_SECOND:
case SQL_INTERVAL_YEAR:
case SQL_INTERVAL_YEAR_TO_MONTH:
case SQL_LONGVARBINARY:
case SQL_LONGVARCHAR:
case SQL_LONGVARNCHAR:
case SQL_NCHAR:
case SQL_NCLOB:
case SQL_NUMERIC:
case SQL_NVARCHAR:
case SQL_REAL:
case SQL_SMALLINT:
case SQL_TIME:
case SQL_TIMESTAMP:
case SQL_TINYINT:
case SQL_TSI_DAY:
case SQL_TSI_FRAC_SECOND:
case SQL_TSI_HOUR:
case SQL_TSI_MICROSECOND:
case SQL_TSI_MINUTE:
case SQL_TSI_MONTH:
case SQL_TSI_QUARTER:
case SQL_TSI_SECOND:
case SQL_TSI_WEEK:
case SQL_TSI_YEAR:
case SQL_VARBINARY:
case SQL_VARCHAR:
case STATE:
case STATEMENT:
case STRUCTURE:
case STYLE:
case SUBCLASS_ORIGIN:
case SUBSTITUTE:
case TABLE_NAME:
case TEMPORARY:
case TIES:
case TIMESTAMPADD:
case TIMESTAMPDIFF:
case TOP_LEVEL_COUNT:
case TRANSACTION:
case TRANSACTIONS_ACTIVE:
case TRANSACTIONS_COMMITTED:
case TRANSACTIONS_ROLLED_BACK:
case TRANSFORM:
case TRANSFORMS:
case TRIGGER_CATALOG:
case TRIGGER_NAME:
case TRIGGER_SCHEMA:
case TYPE:
case UNBOUNDED:
case UNCOMMITTED:
case UNCONDITIONAL:
case UNDER:
case UNNAMED:
case USAGE:
case USER_DEFINED_TYPE_CATALOG:
case USER_DEFINED_TYPE_CODE:
case USER_DEFINED_TYPE_NAME:
case USER_DEFINED_TYPE_SCHEMA:
case UTF8:
case UTF16:
case UTF32:
case VERSION:
case VIEW:
case WEEK:
case WORK:
case WRAPPER:
case WRITE:
case XML:
case ZONE:
case IF:
case MATERIALIZED:
case STORED:
case VIRTUAL:
case JAR:
case FILE:
case ARCHIVE:
case BRACKET_QUOTED_IDENTIFIER:
case QUOTED_IDENTIFIER:
case BACK_QUOTED_IDENTIFIER:
case IDENTIFIER:
case UNICODE_QUOTED_IDENTIFIER:
Option(list);
label_5:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case COMMA:
;
break;
default:
jj_la1[26] = jj_gen;
break label_5;
}
jj_consume_token(COMMA);
Option(list);
}
break;
default:
jj_la1[27] = jj_gen;
;
}
jj_consume_token(RPAREN);
{if (true) return new SqlNodeList(list, s.end(this));}
throw new Error("Missing return statement in function");
}
final public void Option(List list) throws ParseException {
final SqlIdentifier id;
final SqlNode value;
id = SimpleIdentifier();
value = Literal();
list.add(id);
list.add(value);
}
final public SqlNodeList TableElementList() throws ParseException {
final Span s;
final List list = new ArrayList();
jj_consume_token(LPAREN);
s = span();
TableElement(list);
label_6:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case COMMA:
;
break;
default:
jj_la1[28] = jj_gen;
break label_6;
}
jj_consume_token(COMMA);
TableElement(list);
}
jj_consume_token(RPAREN);
{if (true) return new SqlNodeList(list, s.end(this));}
throw new Error("Missing return statement in function");
}
final public void TableElement(List list) throws ParseException {
final SqlIdentifier id;
final SqlDataTypeSpec type;
final boolean nullable;
final SqlNode e;
final SqlNode constraint;
SqlIdentifier name = null;
final SqlNodeList columnList;
final Span s = Span.of();
final ColumnStrategy strategy;
if (jj_2_4(2)) {
id = SimpleIdentifier();
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case A:
case ABSENT:
case ABSOLUTE:
case ACTION:
case ADA:
case ADD:
case ADMIN:
case AFTER:
case ALWAYS:
case ANY:
case APPLY:
case ASC:
case ASSERTION:
case ASSIGNMENT:
case ATTRIBUTE:
case ATTRIBUTES:
case BEFORE:
case BERNOULLI:
case BIGINT:
case BINARY:
case BOOLEAN:
case BREADTH:
case C:
case CASCADE:
case CATALOG:
case CATALOG_NAME:
case CENTURY:
case CHAIN:
case CHAR:
case CHARACTER:
case CHARACTER_SET_CATALOG:
case CHARACTER_SET_NAME:
case CHARACTER_SET_SCHEMA:
case CHARACTERISTICS:
case CHARACTERS:
case CLASS_ORIGIN:
case COBOL:
case COLLATION:
case COLLATION_CATALOG:
case COLLATION_NAME:
case COLLATION_SCHEMA:
case COLUMN_NAME:
case COMMAND_FUNCTION:
case COMMAND_FUNCTION_CODE:
case COMMITTED:
case CONDITIONAL:
case CONDITION_NUMBER:
case CONNECTION:
case CONNECTION_NAME:
case CONSTRAINT_CATALOG:
case CONSTRAINT_NAME:
case CONSTRAINT_SCHEMA:
case CONSTRAINTS:
case CONSTRUCTOR:
case CONTINUE:
case CURSOR_NAME:
case DATA:
case DATABASE:
case DATE:
case DATETIME_INTERVAL_CODE:
case DATETIME_INTERVAL_PRECISION:
case DEC:
case DECADE:
case DECIMAL:
case DEFAULTS:
case DEFERRABLE:
case DEFERRED:
case DEFINED:
case DEFINER:
case DEGREE:
case DEPTH:
case DERIVED:
case DESC:
case DESCRIPTION:
case DESCRIPTOR:
case DIAGNOSTICS:
case DISPATCH:
case DOMAIN:
case DOUBLE:
case DOW:
case DOY:
case DYNAMIC_FUNCTION:
case DYNAMIC_FUNCTION_CODE:
case ENCODING:
case EPOCH:
case ERROR:
case EXCEPTION:
case EXCLUDE:
case EXCLUDING:
case FINAL:
case FIRST:
case FLOAT:
case FOLLOWING:
case FORMAT:
case FORTRAN:
case FOUND:
case FRAC_SECOND:
case G:
case GENERAL:
case GENERATED:
case GEOMETRY:
case GO:
case GOTO:
case GRANTED:
case HIERARCHY:
case IGNORE:
case IMMEDIATE:
case IMMEDIATELY:
case IMPLEMENTATION:
case INCLUDING:
case INCREMENT:
case INITIALLY:
case INPUT:
case INSTANCE:
case INSTANTIABLE:
case INT:
case INTEGER:
case INVOKER:
case ISODOW:
case ISOYEAR:
case ISOLATION:
case JAVA:
case JSON:
case K:
case KEY:
case KEY_MEMBER:
case KEY_TYPE:
case LABEL:
case LAST:
case LENGTH:
case LEVEL:
case LIBRARY:
case LOCATOR:
case M:
case MAP:
case MATCHED:
case MAXVALUE:
case MESSAGE_LENGTH:
case MESSAGE_OCTET_LENGTH:
case MESSAGE_TEXT:
case MICROSECOND:
case MILLISECOND:
case MILLENNIUM:
case MINVALUE:
case MORE_:
case MUMPS:
case NAME:
case NAMES:
case NANOSECOND:
case NESTING:
case NORMALIZED:
case NULLABLE:
case NULLS:
case NUMBER:
case NUMERIC:
case OBJECT:
case OCTETS:
case OPTION:
case OPTIONS:
case ORDERING:
case ORDINALITY:
case OTHERS:
case OUTPUT:
case OVERRIDING:
case PAD:
case PARAMETER_MODE:
case PARAMETER_NAME:
case PARAMETER_ORDINAL_POSITION:
case PARAMETER_SPECIFIC_CATALOG:
case PARAMETER_SPECIFIC_NAME:
case PARAMETER_SPECIFIC_SCHEMA:
case PARTIAL:
case PASCAL:
case PASSING:
case PASSTHROUGH:
case PAST:
case PATH:
case PLACING:
case PLAN:
case PLI:
case PRECEDING:
case PRESERVE:
case PRIOR:
case PRIVILEGES:
case PUBLIC:
case QUARTER:
case READ:
case REAL:
case RELATIVE:
case REPEATABLE:
case REPLACE:
case RESPECT:
case RESTART:
case RESTRICT:
case RETURNED_CARDINALITY:
case RETURNED_LENGTH:
case RETURNED_OCTET_LENGTH:
case RETURNED_SQLSTATE:
case RETURNING:
case ROLE:
case ROUTINE:
case ROUTINE_CATALOG:
case ROUTINE_NAME:
case ROUTINE_SCHEMA:
case ROW:
case ROW_COUNT:
case SCALAR:
case SCALE:
case SCHEMA:
case SCHEMA_NAME:
case SCOPE_CATALOGS:
case SCOPE_NAME:
case SCOPE_SCHEMA:
case SECTION:
case SECURITY:
case SELF:
case SEQUENCE:
case SERIALIZABLE:
case SERVER:
case SERVER_NAME:
case SESSION:
case SETS:
case SIMPLE:
case SIZE:
case SMALLINT:
case SOURCE:
case SPACE:
case SPECIFIC_NAME:
case SQL_BIGINT:
case SQL_BINARY:
case SQL_BIT:
case SQL_BLOB:
case SQL_BOOLEAN:
case SQL_CHAR:
case SQL_CLOB:
case SQL_DATE:
case SQL_DECIMAL:
case SQL_DOUBLE:
case SQL_FLOAT:
case SQL_INTEGER:
case SQL_INTERVAL_DAY:
case SQL_INTERVAL_DAY_TO_HOUR:
case SQL_INTERVAL_DAY_TO_MINUTE:
case SQL_INTERVAL_DAY_TO_SECOND:
case SQL_INTERVAL_HOUR:
case SQL_INTERVAL_HOUR_TO_MINUTE:
case SQL_INTERVAL_HOUR_TO_SECOND:
case SQL_INTERVAL_MINUTE:
case SQL_INTERVAL_MINUTE_TO_SECOND:
case SQL_INTERVAL_MONTH:
case SQL_INTERVAL_SECOND:
case SQL_INTERVAL_YEAR:
case SQL_INTERVAL_YEAR_TO_MONTH:
case SQL_LONGVARBINARY:
case SQL_LONGVARCHAR:
case SQL_LONGVARNCHAR:
case SQL_NCHAR:
case SQL_NCLOB:
case SQL_NUMERIC:
case SQL_NVARCHAR:
case SQL_REAL:
case SQL_SMALLINT:
case SQL_TIME:
case SQL_TIMESTAMP:
case SQL_TINYINT:
case SQL_TSI_DAY:
case SQL_TSI_FRAC_SECOND:
case SQL_TSI_HOUR:
case SQL_TSI_MICROSECOND:
case SQL_TSI_MINUTE:
case SQL_TSI_MONTH:
case SQL_TSI_QUARTER:
case SQL_TSI_SECOND:
case SQL_TSI_WEEK:
case SQL_TSI_YEAR:
case SQL_VARBINARY:
case SQL_VARCHAR:
case STATE:
case STATEMENT:
case STRUCTURE:
case STYLE:
case SUBCLASS_ORIGIN:
case SUBSTITUTE:
case TABLE_NAME:
case TEMPORARY:
case TIES:
case TIME:
case TIMESTAMP:
case TIMESTAMPADD:
case TIMESTAMPDIFF:
case TINYINT:
case TOP_LEVEL_COUNT:
case TRANSACTION:
case TRANSACTIONS_ACTIVE:
case TRANSACTIONS_COMMITTED:
case TRANSACTIONS_ROLLED_BACK:
case TRANSFORM:
case TRANSFORMS:
case TRIGGER_CATALOG:
case TRIGGER_NAME:
case TRIGGER_SCHEMA:
case TYPE:
case UNBOUNDED:
case UNCOMMITTED:
case UNCONDITIONAL:
case UNDER:
case UNNAMED:
case USAGE:
case USER_DEFINED_TYPE_CATALOG:
case USER_DEFINED_TYPE_CODE:
case USER_DEFINED_TYPE_NAME:
case USER_DEFINED_TYPE_SCHEMA:
case UTF8:
case UTF16:
case UTF32:
case VARBINARY:
case VARCHAR:
case VERSION:
case VIEW:
case WEEK:
case WORK:
case WRAPPER:
case WRITE:
case XML:
case ZONE:
case IF:
case MATERIALIZED:
case STORED:
case VIRTUAL:
case JAR:
case FILE:
case ARCHIVE:
case BRACKET_QUOTED_IDENTIFIER:
case QUOTED_IDENTIFIER:
case BACK_QUOTED_IDENTIFIER:
case IDENTIFIER:
case UNICODE_QUOTED_IDENTIFIER:
type = DataType();
nullable = NullableOptDefaultTrue();
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case AS:
case GENERATED:
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case GENERATED:
jj_consume_token(GENERATED);
jj_consume_token(ALWAYS);
break;
default:
jj_la1[29] = jj_gen;
;
}
jj_consume_token(AS);
jj_consume_token(LPAREN);
e = Expression(ExprContext.ACCEPT_SUB_QUERY);
jj_consume_token(RPAREN);
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case VIRTUAL:
jj_consume_token(VIRTUAL);
strategy = ColumnStrategy.VIRTUAL;
break;
case STORED:
jj_consume_token(STORED);
strategy = ColumnStrategy.STORED;
break;
default:
jj_la1[30] = jj_gen;
strategy = ColumnStrategy.VIRTUAL;
}
break;
case DEFAULT_:
jj_consume_token(DEFAULT_);
e = Expression(ExprContext.ACCEPT_SUB_QUERY);
strategy = ColumnStrategy.DEFAULT;
break;
default:
jj_la1[31] = jj_gen;
e = null;
strategy = nullable ? ColumnStrategy.NULLABLE
: ColumnStrategy.NOT_NULLABLE;
}
list.add(
SqlDdlNodes.column(s.add(id).end(this), id,
type.withNullable(nullable), e, strategy));
break;
default:
jj_la1[32] = jj_gen;
list.add(id);
}
} else {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case A:
case ABSENT:
case ABSOLUTE:
case ACTION:
case ADA:
case ADD:
case ADMIN:
case AFTER:
case ALWAYS:
case APPLY:
case ASC:
case ASSERTION:
case ASSIGNMENT:
case ATTRIBUTE:
case ATTRIBUTES:
case BEFORE:
case BERNOULLI:
case BREADTH:
case C:
case CASCADE:
case CATALOG:
case CATALOG_NAME:
case CENTURY:
case CHAIN:
case CHARACTER_SET_CATALOG:
case CHARACTER_SET_NAME:
case CHARACTER_SET_SCHEMA:
case CHARACTERISTICS:
case CHARACTERS:
case CLASS_ORIGIN:
case COBOL:
case COLLATION:
case COLLATION_CATALOG:
case COLLATION_NAME:
case COLLATION_SCHEMA:
case COLUMN_NAME:
case COMMAND_FUNCTION:
case COMMAND_FUNCTION_CODE:
case COMMITTED:
case CONDITIONAL:
case CONDITION_NUMBER:
case CONNECTION:
case CONNECTION_NAME:
case CONSTRAINT_CATALOG:
case CONSTRAINT_NAME:
case CONSTRAINT_SCHEMA:
case CONSTRAINTS:
case CONSTRUCTOR:
case CONTINUE:
case CURSOR_NAME:
case DATA:
case DATABASE:
case DATETIME_INTERVAL_CODE:
case DATETIME_INTERVAL_PRECISION:
case DECADE:
case DEFAULTS:
case DEFERRABLE:
case DEFERRED:
case DEFINED:
case DEFINER:
case DEGREE:
case DEPTH:
case DERIVED:
case DESC:
case DESCRIPTION:
case DESCRIPTOR:
case DIAGNOSTICS:
case DISPATCH:
case DOMAIN:
case DOW:
case DOY:
case DYNAMIC_FUNCTION:
case DYNAMIC_FUNCTION_CODE:
case ENCODING:
case EPOCH:
case ERROR:
case EXCEPTION:
case EXCLUDE:
case EXCLUDING:
case FINAL:
case FIRST:
case FOLLOWING:
case FORMAT:
case FORTRAN:
case FOUND:
case FRAC_SECOND:
case G:
case GENERAL:
case GENERATED:
case GEOMETRY:
case GO:
case GOTO:
case GRANTED:
case HIERARCHY:
case IGNORE:
case IMMEDIATE:
case IMMEDIATELY:
case IMPLEMENTATION:
case INCLUDING:
case INCREMENT:
case INITIALLY:
case INPUT:
case INSTANCE:
case INSTANTIABLE:
case INVOKER:
case ISODOW:
case ISOYEAR:
case ISOLATION:
case JAVA:
case JSON:
case K:
case KEY:
case KEY_MEMBER:
case KEY_TYPE:
case LABEL:
case LAST:
case LENGTH:
case LEVEL:
case LIBRARY:
case LOCATOR:
case M:
case MAP:
case MATCHED:
case MAXVALUE:
case MESSAGE_LENGTH:
case MESSAGE_OCTET_LENGTH:
case MESSAGE_TEXT:
case MICROSECOND:
case MILLISECOND:
case MILLENNIUM:
case MINVALUE:
case MORE_:
case MUMPS:
case NAME:
case NAMES:
case NANOSECOND:
case NESTING:
case NORMALIZED:
case NULLABLE:
case NULLS:
case NUMBER:
case OBJECT:
case OCTETS:
case OPTION:
case OPTIONS:
case ORDERING:
case ORDINALITY:
case OTHERS:
case OUTPUT:
case OVERRIDING:
case PAD:
case PARAMETER_MODE:
case PARAMETER_NAME:
case PARAMETER_ORDINAL_POSITION:
case PARAMETER_SPECIFIC_CATALOG:
case PARAMETER_SPECIFIC_NAME:
case PARAMETER_SPECIFIC_SCHEMA:
case PARTIAL:
case PASCAL:
case PASSING:
case PASSTHROUGH:
case PAST:
case PATH:
case PLACING:
case PLAN:
case PLI:
case PRECEDING:
case PRESERVE:
case PRIOR:
case PRIVILEGES:
case PUBLIC:
case QUARTER:
case READ:
case RELATIVE:
case REPEATABLE:
case REPLACE:
case RESPECT:
case RESTART:
case RESTRICT:
case RETURNED_CARDINALITY:
case RETURNED_LENGTH:
case RETURNED_OCTET_LENGTH:
case RETURNED_SQLSTATE:
case RETURNING:
case ROLE:
case ROUTINE:
case ROUTINE_CATALOG:
case ROUTINE_NAME:
case ROUTINE_SCHEMA:
case ROW_COUNT:
case SCALAR:
case SCALE:
case SCHEMA:
case SCHEMA_NAME:
case SCOPE_CATALOGS:
case SCOPE_NAME:
case SCOPE_SCHEMA:
case SECTION:
case SECURITY:
case SELF:
case SEQUENCE:
case SERIALIZABLE:
case SERVER:
case SERVER_NAME:
case SESSION:
case SETS:
case SIMPLE:
case SIZE:
case SOURCE:
case SPACE:
case SPECIFIC_NAME:
case SQL_BIGINT:
case SQL_BINARY:
case SQL_BIT:
case SQL_BLOB:
case SQL_BOOLEAN:
case SQL_CHAR:
case SQL_CLOB:
case SQL_DATE:
case SQL_DECIMAL:
case SQL_DOUBLE:
case SQL_FLOAT:
case SQL_INTEGER:
case SQL_INTERVAL_DAY:
case SQL_INTERVAL_DAY_TO_HOUR:
case SQL_INTERVAL_DAY_TO_MINUTE:
case SQL_INTERVAL_DAY_TO_SECOND:
case SQL_INTERVAL_HOUR:
case SQL_INTERVAL_HOUR_TO_MINUTE:
case SQL_INTERVAL_HOUR_TO_SECOND:
case SQL_INTERVAL_MINUTE:
case SQL_INTERVAL_MINUTE_TO_SECOND:
case SQL_INTERVAL_MONTH:
case SQL_INTERVAL_SECOND:
case SQL_INTERVAL_YEAR:
case SQL_INTERVAL_YEAR_TO_MONTH:
case SQL_LONGVARBINARY:
case SQL_LONGVARCHAR:
case SQL_LONGVARNCHAR:
case SQL_NCHAR:
case SQL_NCLOB:
case SQL_NUMERIC:
case SQL_NVARCHAR:
case SQL_REAL:
case SQL_SMALLINT:
case SQL_TIME:
case SQL_TIMESTAMP:
case SQL_TINYINT:
case SQL_TSI_DAY:
case SQL_TSI_FRAC_SECOND:
case SQL_TSI_HOUR:
case SQL_TSI_MICROSECOND:
case SQL_TSI_MINUTE:
case SQL_TSI_MONTH:
case SQL_TSI_QUARTER:
case SQL_TSI_SECOND:
case SQL_TSI_WEEK:
case SQL_TSI_YEAR:
case SQL_VARBINARY:
case SQL_VARCHAR:
case STATE:
case STATEMENT:
case STRUCTURE:
case STYLE:
case SUBCLASS_ORIGIN:
case SUBSTITUTE:
case TABLE_NAME:
case TEMPORARY:
case TIES:
case TIMESTAMPADD:
case TIMESTAMPDIFF:
case TOP_LEVEL_COUNT:
case TRANSACTION:
case TRANSACTIONS_ACTIVE:
case TRANSACTIONS_COMMITTED:
case TRANSACTIONS_ROLLED_BACK:
case TRANSFORM:
case TRANSFORMS:
case TRIGGER_CATALOG:
case TRIGGER_NAME:
case TRIGGER_SCHEMA:
case TYPE:
case UNBOUNDED:
case UNCOMMITTED:
case UNCONDITIONAL:
case UNDER:
case UNNAMED:
case USAGE:
case USER_DEFINED_TYPE_CATALOG:
case USER_DEFINED_TYPE_CODE:
case USER_DEFINED_TYPE_NAME:
case USER_DEFINED_TYPE_SCHEMA:
case UTF8:
case UTF16:
case UTF32:
case VERSION:
case VIEW:
case WEEK:
case WORK:
case WRAPPER:
case WRITE:
case XML:
case ZONE:
case IF:
case MATERIALIZED:
case STORED:
case VIRTUAL:
case JAR:
case FILE:
case ARCHIVE:
case BRACKET_QUOTED_IDENTIFIER:
case QUOTED_IDENTIFIER:
case BACK_QUOTED_IDENTIFIER:
case IDENTIFIER:
case UNICODE_QUOTED_IDENTIFIER:
id = SimpleIdentifier();
list.add(id);
break;
case CHECK:
case CONSTRAINT:
case PRIMARY:
case UNIQUE:
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case CONSTRAINT:
jj_consume_token(CONSTRAINT);
s.add(this);
name = SimpleIdentifier();
break;
default:
jj_la1[33] = jj_gen;
;
}
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case CHECK:
jj_consume_token(CHECK);
s.add(this);
jj_consume_token(LPAREN);
e = Expression(ExprContext.ACCEPT_SUB_QUERY);
jj_consume_token(RPAREN);
list.add(SqlDdlNodes.check(s.end(this), name, e));
break;
case UNIQUE:
jj_consume_token(UNIQUE);
s.add(this);
columnList = ParenthesizedSimpleIdentifierList();
list.add(SqlDdlNodes.unique(s.end(columnList), name, columnList));
break;
case PRIMARY:
jj_consume_token(PRIMARY);
s.add(this);
jj_consume_token(KEY);
columnList = ParenthesizedSimpleIdentifierList();
list.add(SqlDdlNodes.primary(s.end(columnList), name, columnList));
break;
default:
jj_la1[34] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
break;
default:
jj_la1[35] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
}
}
final public SqlNodeList AttributeDefList() throws ParseException {
final Span s;
final List list = new ArrayList();
jj_consume_token(LPAREN);
s = span();
AttributeDef(list);
label_7:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case COMMA:
;
break;
default:
jj_la1[36] = jj_gen;
break label_7;
}
jj_consume_token(COMMA);
AttributeDef(list);
}
jj_consume_token(RPAREN);
{if (true) return new SqlNodeList(list, s.end(this));}
throw new Error("Missing return statement in function");
}
final public void AttributeDef(List list) throws ParseException {
final SqlIdentifier id;
final SqlDataTypeSpec type;
final boolean nullable;
SqlNode e = null;
final Span s = Span.of();
id = SimpleIdentifier();
type = DataType();
nullable = NullableOptDefaultTrue();
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case DEFAULT_:
jj_consume_token(DEFAULT_);
e = Expression(ExprContext.ACCEPT_SUB_QUERY);
break;
default:
jj_la1[37] = jj_gen;
;
}
list.add(SqlDdlNodes.attribute(s.add(id).end(this), id,
type.withNullable(nullable), e, null));
}
final public SqlCreate SqlCreateType(Span s, boolean replace) throws ParseException {
final SqlIdentifier id;
SqlNodeList attributeDefList = null;
SqlDataTypeSpec type = null;
jj_consume_token(TYPE);
id = CompoundIdentifier();
jj_consume_token(AS);
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case LPAREN:
attributeDefList = AttributeDefList();
break;
case A:
case ABSENT:
case ABSOLUTE:
case ACTION:
case ADA:
case ADD:
case ADMIN:
case AFTER:
case ALWAYS:
case ANY:
case APPLY:
case ASC:
case ASSERTION:
case ASSIGNMENT:
case ATTRIBUTE:
case ATTRIBUTES:
case BEFORE:
case BERNOULLI:
case BIGINT:
case BINARY:
case BOOLEAN:
case BREADTH:
case C:
case CASCADE:
case CATALOG:
case CATALOG_NAME:
case CENTURY:
case CHAIN:
case CHAR:
case CHARACTER:
case CHARACTER_SET_CATALOG:
case CHARACTER_SET_NAME:
case CHARACTER_SET_SCHEMA:
case CHARACTERISTICS:
case CHARACTERS:
case CLASS_ORIGIN:
case COBOL:
case COLLATION:
case COLLATION_CATALOG:
case COLLATION_NAME:
case COLLATION_SCHEMA:
case COLUMN_NAME:
case COMMAND_FUNCTION:
case COMMAND_FUNCTION_CODE:
case COMMITTED:
case CONDITIONAL:
case CONDITION_NUMBER:
case CONNECTION:
case CONNECTION_NAME:
case CONSTRAINT_CATALOG:
case CONSTRAINT_NAME:
case CONSTRAINT_SCHEMA:
case CONSTRAINTS:
case CONSTRUCTOR:
case CONTINUE:
case CURSOR_NAME:
case DATA:
case DATABASE:
case DATE:
case DATETIME_INTERVAL_CODE:
case DATETIME_INTERVAL_PRECISION:
case DEC:
case DECADE:
case DECIMAL:
case DEFAULTS:
case DEFERRABLE:
case DEFERRED:
case DEFINED:
case DEFINER:
case DEGREE:
case DEPTH:
case DERIVED:
case DESC:
case DESCRIPTION:
case DESCRIPTOR:
case DIAGNOSTICS:
case DISPATCH:
case DOMAIN:
case DOUBLE:
case DOW:
case DOY:
case DYNAMIC_FUNCTION:
case DYNAMIC_FUNCTION_CODE:
case ENCODING:
case EPOCH:
case ERROR:
case EXCEPTION:
case EXCLUDE:
case EXCLUDING:
case FINAL:
case FIRST:
case FLOAT:
case FOLLOWING:
case FORMAT:
case FORTRAN:
case FOUND:
case FRAC_SECOND:
case G:
case GENERAL:
case GENERATED:
case GEOMETRY:
case GO:
case GOTO:
case GRANTED:
case HIERARCHY:
case IGNORE:
case IMMEDIATE:
case IMMEDIATELY:
case IMPLEMENTATION:
case INCLUDING:
case INCREMENT:
case INITIALLY:
case INPUT:
case INSTANCE:
case INSTANTIABLE:
case INT:
case INTEGER:
case INVOKER:
case ISODOW:
case ISOYEAR:
case ISOLATION:
case JAVA:
case JSON:
case K:
case KEY:
case KEY_MEMBER:
case KEY_TYPE:
case LABEL:
case LAST:
case LENGTH:
case LEVEL:
case LIBRARY:
case LOCATOR:
case M:
case MAP:
case MATCHED:
case MAXVALUE:
case MESSAGE_LENGTH:
case MESSAGE_OCTET_LENGTH:
case MESSAGE_TEXT:
case MICROSECOND:
case MILLISECOND:
case MILLENNIUM:
case MINVALUE:
case MORE_:
case MUMPS:
case NAME:
case NAMES:
case NANOSECOND:
case NESTING:
case NORMALIZED:
case NULLABLE:
case NULLS:
case NUMBER:
case NUMERIC:
case OBJECT:
case OCTETS:
case OPTION:
case OPTIONS:
case ORDERING:
case ORDINALITY:
case OTHERS:
case OUTPUT:
case OVERRIDING:
case PAD:
case PARAMETER_MODE:
case PARAMETER_NAME:
case PARAMETER_ORDINAL_POSITION:
case PARAMETER_SPECIFIC_CATALOG:
case PARAMETER_SPECIFIC_NAME:
case PARAMETER_SPECIFIC_SCHEMA:
case PARTIAL:
case PASCAL:
case PASSING:
case PASSTHROUGH:
case PAST:
case PATH:
case PLACING:
case PLAN:
case PLI:
case PRECEDING:
case PRESERVE:
case PRIOR:
case PRIVILEGES:
case PUBLIC:
case QUARTER:
case READ:
case REAL:
case RELATIVE:
case REPEATABLE:
case REPLACE:
case RESPECT:
case RESTART:
case RESTRICT:
case RETURNED_CARDINALITY:
case RETURNED_LENGTH:
case RETURNED_OCTET_LENGTH:
case RETURNED_SQLSTATE:
case RETURNING:
case ROLE:
case ROUTINE:
case ROUTINE_CATALOG:
case ROUTINE_NAME:
case ROUTINE_SCHEMA:
case ROW:
case ROW_COUNT:
case SCALAR:
case SCALE:
case SCHEMA:
case SCHEMA_NAME:
case SCOPE_CATALOGS:
case SCOPE_NAME:
case SCOPE_SCHEMA:
case SECTION:
case SECURITY:
case SELF:
case SEQUENCE:
case SERIALIZABLE:
case SERVER:
case SERVER_NAME:
case SESSION:
case SETS:
case SIMPLE:
case SIZE:
case SMALLINT:
case SOURCE:
case SPACE:
case SPECIFIC_NAME:
case SQL_BIGINT:
case SQL_BINARY:
case SQL_BIT:
case SQL_BLOB:
case SQL_BOOLEAN:
case SQL_CHAR:
case SQL_CLOB:
case SQL_DATE:
case SQL_DECIMAL:
case SQL_DOUBLE:
case SQL_FLOAT:
case SQL_INTEGER:
case SQL_INTERVAL_DAY:
case SQL_INTERVAL_DAY_TO_HOUR:
case SQL_INTERVAL_DAY_TO_MINUTE:
case SQL_INTERVAL_DAY_TO_SECOND:
case SQL_INTERVAL_HOUR:
case SQL_INTERVAL_HOUR_TO_MINUTE:
case SQL_INTERVAL_HOUR_TO_SECOND:
case SQL_INTERVAL_MINUTE:
case SQL_INTERVAL_MINUTE_TO_SECOND:
case SQL_INTERVAL_MONTH:
case SQL_INTERVAL_SECOND:
case SQL_INTERVAL_YEAR:
case SQL_INTERVAL_YEAR_TO_MONTH:
case SQL_LONGVARBINARY:
case SQL_LONGVARCHAR:
case SQL_LONGVARNCHAR:
case SQL_NCHAR:
case SQL_NCLOB:
case SQL_NUMERIC:
case SQL_NVARCHAR:
case SQL_REAL:
case SQL_SMALLINT:
case SQL_TIME:
case SQL_TIMESTAMP:
case SQL_TINYINT:
case SQL_TSI_DAY:
case SQL_TSI_FRAC_SECOND:
case SQL_TSI_HOUR:
case SQL_TSI_MICROSECOND:
case SQL_TSI_MINUTE:
case SQL_TSI_MONTH:
case SQL_TSI_QUARTER:
case SQL_TSI_SECOND:
case SQL_TSI_WEEK:
case SQL_TSI_YEAR:
case SQL_VARBINARY:
case SQL_VARCHAR:
case STATE:
case STATEMENT:
case STRUCTURE:
case STYLE:
case SUBCLASS_ORIGIN:
case SUBSTITUTE:
case TABLE_NAME:
case TEMPORARY:
case TIES:
case TIME:
case TIMESTAMP:
case TIMESTAMPADD:
case TIMESTAMPDIFF:
case TINYINT:
case TOP_LEVEL_COUNT:
case TRANSACTION:
case TRANSACTIONS_ACTIVE:
case TRANSACTIONS_COMMITTED:
case TRANSACTIONS_ROLLED_BACK:
case TRANSFORM:
case TRANSFORMS:
case TRIGGER_CATALOG:
case TRIGGER_NAME:
case TRIGGER_SCHEMA:
case TYPE:
case UNBOUNDED:
case UNCOMMITTED:
case UNCONDITIONAL:
case UNDER:
case UNNAMED:
case USAGE:
case USER_DEFINED_TYPE_CATALOG:
case USER_DEFINED_TYPE_CODE:
case USER_DEFINED_TYPE_NAME:
case USER_DEFINED_TYPE_SCHEMA:
case UTF8:
case UTF16:
case UTF32:
case VARBINARY:
case VARCHAR:
case VERSION:
case VIEW:
case WEEK:
case WORK:
case WRAPPER:
case WRITE:
case XML:
case ZONE:
case IF:
case MATERIALIZED:
case STORED:
case VIRTUAL:
case JAR:
case FILE:
case ARCHIVE:
case BRACKET_QUOTED_IDENTIFIER:
case QUOTED_IDENTIFIER:
case BACK_QUOTED_IDENTIFIER:
case IDENTIFIER:
case UNICODE_QUOTED_IDENTIFIER:
type = DataType();
break;
default:
jj_la1[38] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
{if (true) return SqlDdlNodes.createType(s.end(this), replace, id, attributeDefList, type);}
throw new Error("Missing return statement in function");
}
final public SqlCreate SqlCreateTable(Span s, boolean replace) throws ParseException {
final boolean ifNotExists;
final SqlIdentifier id;
SqlNodeList tableElementList = null;
SqlNode query = null;
jj_consume_token(TABLE);
ifNotExists = IfNotExistsOpt();
id = CompoundIdentifier();
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case LPAREN:
tableElementList = TableElementList();
break;
default:
jj_la1[39] = jj_gen;
;
}
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case AS:
jj_consume_token(AS);
query = OrderedQueryOrExpr(ExprContext.ACCEPT_QUERY);
break;
default:
jj_la1[40] = jj_gen;
;
}
{if (true) return SqlDdlNodes.createTable(s.end(this), replace, ifNotExists, id,
tableElementList, query);}
throw new Error("Missing return statement in function");
}
final public SqlCreate SqlCreateView(Span s, boolean replace) throws ParseException {
final SqlIdentifier id;
SqlNodeList columnList = null;
final SqlNode query;
jj_consume_token(VIEW);
id = CompoundIdentifier();
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case LPAREN:
columnList = ParenthesizedSimpleIdentifierList();
break;
default:
jj_la1[41] = jj_gen;
;
}
jj_consume_token(AS);
query = OrderedQueryOrExpr(ExprContext.ACCEPT_QUERY);
{if (true) return SqlDdlNodes.createView(s.end(this), replace, id, columnList,
query);}
throw new Error("Missing return statement in function");
}
final public SqlCreate SqlCreateMaterializedView(Span s, boolean replace) throws ParseException {
final boolean ifNotExists;
final SqlIdentifier id;
SqlNodeList columnList = null;
final SqlNode query;
jj_consume_token(MATERIALIZED);
jj_consume_token(VIEW);
ifNotExists = IfNotExistsOpt();
id = CompoundIdentifier();
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case LPAREN:
columnList = ParenthesizedSimpleIdentifierList();
break;
default:
jj_la1[42] = jj_gen;
;
}
jj_consume_token(AS);
query = OrderedQueryOrExpr(ExprContext.ACCEPT_QUERY);
{if (true) return SqlDdlNodes.createMaterializedView(s.end(this), replace,
ifNotExists, id, columnList, query);}
throw new Error("Missing return statement in function");
}
final private void FunctionJarDef(SqlNodeList usingList) throws ParseException {
final SqlDdlNodes.FileType fileType;
final SqlNode uri;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case ARCHIVE:
jj_consume_token(ARCHIVE);
fileType = SqlDdlNodes.FileType.ARCHIVE;
break;
case FILE:
jj_consume_token(FILE);
fileType = SqlDdlNodes.FileType.FILE;
break;
case JAR:
jj_consume_token(JAR);
fileType = SqlDdlNodes.FileType.JAR;
break;
default:
jj_la1[43] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
usingList.add(SqlLiteral.createSymbol(fileType, getPos()));
uri = StringLiteral();
usingList.add(uri);
}
final public SqlCreate SqlCreateFunction(Span s, boolean replace) throws ParseException {
final boolean ifNotExists;
final SqlIdentifier id;
final SqlNode className;
SqlNodeList usingList = SqlNodeList.EMPTY;
jj_consume_token(FUNCTION);
ifNotExists = IfNotExistsOpt();
id = CompoundIdentifier();
jj_consume_token(AS);
className = StringLiteral();
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case USING:
jj_consume_token(USING);
usingList = new SqlNodeList(getPos());
FunctionJarDef(usingList);
label_8:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case COMMA:
;
break;
default:
jj_la1[44] = jj_gen;
break label_8;
}
jj_consume_token(COMMA);
FunctionJarDef(usingList);
}
break;
default:
jj_la1[45] = jj_gen;
;
}
{if (true) return SqlDdlNodes.createFunction(s.end(this), replace, ifNotExists,
id, className, usingList);}
throw new Error("Missing return statement in function");
}
final public SqlDrop SqlDropSchema(Span s, boolean replace) throws ParseException {
final boolean ifExists;
final SqlIdentifier id;
final boolean foreign;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case FOREIGN:
jj_consume_token(FOREIGN);
foreign = true;
break;
default:
jj_la1[46] = jj_gen;
foreign = false;
}
jj_consume_token(SCHEMA);
ifExists = IfExistsOpt();
id = CompoundIdentifier();
{if (true) return SqlDdlNodes.dropSchema(s.end(this), foreign, ifExists, id);}
throw new Error("Missing return statement in function");
}
final public SqlDrop SqlDropType(Span s, boolean replace) throws ParseException {
final boolean ifExists;
final SqlIdentifier id;
jj_consume_token(TYPE);
ifExists = IfExistsOpt();
id = CompoundIdentifier();
{if (true) return SqlDdlNodes.dropType(s.end(this), ifExists, id);}
throw new Error("Missing return statement in function");
}
final public SqlDrop SqlDropTable(Span s, boolean replace) throws ParseException {
final boolean ifExists;
final SqlIdentifier id;
jj_consume_token(TABLE);
ifExists = IfExistsOpt();
id = CompoundIdentifier();
{if (true) return SqlDdlNodes.dropTable(s.end(this), ifExists, id);}
throw new Error("Missing return statement in function");
}
final public SqlDrop SqlDropView(Span s, boolean replace) throws ParseException {
final boolean ifExists;
final SqlIdentifier id;
jj_consume_token(VIEW);
ifExists = IfExistsOpt();
id = CompoundIdentifier();
{if (true) return SqlDdlNodes.dropView(s.end(this), ifExists, id);}
throw new Error("Missing return statement in function");
}
final public SqlDrop SqlDropMaterializedView(Span s, boolean replace) throws ParseException {
final boolean ifExists;
final SqlIdentifier id;
jj_consume_token(MATERIALIZED);
jj_consume_token(VIEW);
ifExists = IfExistsOpt();
id = CompoundIdentifier();
{if (true) return SqlDdlNodes.dropMaterializedView(s.end(this), ifExists, id);}
throw new Error("Missing return statement in function");
}
final public SqlDrop SqlDropFunction(Span s, boolean replace) throws ParseException {
final boolean ifExists;
final SqlIdentifier id;
jj_consume_token(FUNCTION);
ifExists = IfExistsOpt();
id = CompoundIdentifier();
{if (true) return SqlDdlNodes.dropFunction(s.end(this), ifExists, id);}
throw new Error("Missing return statement in function");
}
// End parserImpls.ftl
/**
* Parses a leaf SELECT expression without ORDER BY.
*/
final public SqlSelect SqlSelect() throws ParseException {
final List keywords = new ArrayList();
final SqlNodeList keywordList;
List selectList;
final SqlNode fromClause;
final SqlNode where;
final SqlNodeList groupBy;
final SqlNode having;
final SqlNodeList windowDecls;
final Span s;
jj_consume_token(SELECT);
s = span();
SqlSelectKeywords(keywords);
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case STREAM:
jj_consume_token(STREAM);
keywords.add(SqlSelectKeyword.STREAM.symbol(getPos()));
break;
default:
jj_la1[47] = jj_gen;
;
}
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case ALL:
case DISTINCT:
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case DISTINCT:
jj_consume_token(DISTINCT);
keywords.add(SqlSelectKeyword.DISTINCT.symbol(getPos()));
break;
case ALL:
jj_consume_token(ALL);
keywords.add(SqlSelectKeyword.ALL.symbol(getPos()));
break;
default:
jj_la1[48] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
break;
default:
jj_la1[49] = jj_gen;
;
}
keywordList = new SqlNodeList(keywords, s.addAll(keywords).pos());
selectList = SelectList();
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case FROM:
jj_consume_token(FROM);
fromClause = FromClause();
where = WhereOpt();
groupBy = GroupByOpt();
having = HavingOpt();
windowDecls = WindowOpt();
break;
default:
jj_la1[50] = jj_gen;
E();
fromClause = null;
where = null;
groupBy = null;
having = null;
windowDecls = null;
}
{if (true) return new SqlSelect(s.end(this), keywordList,
new SqlNodeList(selectList, Span.of(selectList).pos()),
fromClause, where, groupBy, having, windowDecls, null, null, null);}
throw new Error("Missing return statement in function");
}
/*
* Abstract production:
*
* void SqlSelectKeywords(List keywords)
*
* Parses dialect-specific keywords immediately following the SELECT keyword.
*/
/**
* Parses an EXPLAIN PLAN statement.
*/
final public SqlNode SqlExplain() throws ParseException {
SqlNode stmt;
SqlExplainLevel detailLevel = SqlExplainLevel.EXPPLAN_ATTRIBUTES;
SqlExplain.Depth depth;
final SqlExplainFormat format;
jj_consume_token(EXPLAIN);
jj_consume_token(PLAN);
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case EXCLUDING:
case INCLUDING:
detailLevel = ExplainDetailLevel();
break;
default:
jj_la1[51] = jj_gen;
;
}
depth = ExplainDepth();
if (jj_2_5(2)) {
jj_consume_token(AS);
jj_consume_token(XML);
format = SqlExplainFormat.XML;
} else {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case AS:
jj_consume_token(AS);
jj_consume_token(JSON);
format = SqlExplainFormat.JSON;
break;
default:
jj_la1[52] = jj_gen;
format = SqlExplainFormat.TEXT;
}
}
jj_consume_token(FOR);
stmt = SqlQueryOrDml();
{if (true) return new SqlExplain(getPos(),
stmt,
detailLevel.symbol(SqlParserPos.ZERO),
depth.symbol(SqlParserPos.ZERO),
format.symbol(SqlParserPos.ZERO),
nDynamicParams);}
throw new Error("Missing return statement in function");
}
/** Parses a query (SELECT or VALUES)
* or DML statement (INSERT, UPDATE, DELETE, MERGE). */
final public SqlNode SqlQueryOrDml() throws ParseException {
SqlNode stmt;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case A:
case ABS:
case ABSENT:
case ABSOLUTE:
case ACTION:
case ADA:
case ADD:
case ADMIN:
case AFTER:
case ALWAYS:
case APPLY:
case ARRAY:
case ASC:
case ASSERTION:
case ASSIGNMENT:
case ATTRIBUTE:
case ATTRIBUTES:
case AVG:
case BEFORE:
case BERNOULLI:
case BREADTH:
case C:
case CARDINALITY:
case CASCADE:
case CASE:
case CAST:
case CATALOG:
case CATALOG_NAME:
case CEIL:
case CEILING:
case CENTURY:
case CHAIN:
case CHAR_LENGTH:
case CHARACTER_LENGTH:
case CHARACTER_SET_CATALOG:
case CHARACTER_SET_NAME:
case CHARACTER_SET_SCHEMA:
case CHARACTERISTICS:
case CHARACTERS:
case CLASSIFIER:
case CLASS_ORIGIN:
case COALESCE:
case COBOL:
case COLLATION:
case COLLATION_CATALOG:
case COLLATION_NAME:
case COLLATION_SCHEMA:
case COLLECT:
case COLUMN_NAME:
case COMMAND_FUNCTION:
case COMMAND_FUNCTION_CODE:
case COMMITTED:
case CONDITIONAL:
case CONDITION_NUMBER:
case CONNECTION:
case CONNECTION_NAME:
case CONSTRAINT_CATALOG:
case CONSTRAINT_NAME:
case CONSTRAINT_SCHEMA:
case CONSTRAINTS:
case CONSTRUCTOR:
case CONTINUE:
case CONVERT:
case COUNT:
case COVAR_POP:
case COVAR_SAMP:
case CUME_DIST:
case CURRENT:
case CURRENT_CATALOG:
case CURRENT_DATE:
case CURRENT_DEFAULT_TRANSFORM_GROUP:
case CURRENT_PATH:
case CURRENT_ROLE:
case CURRENT_SCHEMA:
case CURRENT_TIME:
case CURRENT_TIMESTAMP:
case CURRENT_USER:
case CURSOR:
case CURSOR_NAME:
case DATA:
case DATABASE:
case DATE:
case DATETIME_INTERVAL_CODE:
case DATETIME_INTERVAL_PRECISION:
case DECADE:
case DEFAULTS:
case DEFERRABLE:
case DEFERRED:
case DEFINED:
case DEFINER:
case DEGREE:
case DENSE_RANK:
case DEPTH:
case DERIVED:
case DESC:
case DESCRIPTION:
case DESCRIPTOR:
case DIAGNOSTICS:
case DISPATCH:
case DOMAIN:
case DOW:
case DOY:
case DYNAMIC_FUNCTION:
case DYNAMIC_FUNCTION_CODE:
case ELEMENT:
case ENCODING:
case EPOCH:
case ERROR:
case EXCEPTION:
case EXCLUDE:
case EXCLUDING:
case EXISTS:
case EXP:
case EXTRACT:
case FALSE:
case FINAL:
case FIRST:
case FIRST_VALUE:
case FLOOR:
case FOLLOWING:
case FORMAT:
case FORTRAN:
case FOUND:
case FRAC_SECOND:
case FUSION:
case G:
case GENERAL:
case GENERATED:
case GEOMETRY:
case GO:
case GOTO:
case GRANTED:
case GROUPING:
case HIERARCHY:
case HOUR:
case IGNORE:
case IMMEDIATE:
case IMMEDIATELY:
case IMPLEMENTATION:
case INCLUDING:
case INCREMENT:
case INITIALLY:
case INPUT:
case INSTANCE:
case INSTANTIABLE:
case INTERVAL:
case INVOKER:
case ISODOW:
case ISOYEAR:
case ISOLATION:
case JAVA:
case JSON:
case JSON_ARRAY:
case JSON_ARRAYAGG:
case JSON_EXISTS:
case JSON_OBJECT:
case JSON_OBJECTAGG:
case JSON_QUERY:
case JSON_VALUE:
case K:
case KEY:
case KEY_MEMBER:
case KEY_TYPE:
case LABEL:
case LAG:
case LAST:
case LAST_VALUE:
case LEAD:
case LEFT:
case LENGTH:
case LEVEL:
case LIBRARY:
case LN:
case LOCALTIME:
case LOCALTIMESTAMP:
case LOCATOR:
case LOWER:
case M:
case MAP:
case MATCHED:
case MATCH_NUMBER:
case MAX:
case MAXVALUE:
case MESSAGE_LENGTH:
case MESSAGE_OCTET_LENGTH:
case MESSAGE_TEXT:
case MICROSECOND:
case MILLISECOND:
case MILLENNIUM:
case MIN:
case MINUTE:
case MINVALUE:
case MOD:
case MONTH:
case MORE_:
case MULTISET:
case MUMPS:
case NAME:
case NAMES:
case NANOSECOND:
case NESTING:
case NEW:
case NEXT:
case NORMALIZED:
case NOT:
case NTH_VALUE:
case NTILE:
case NULL:
case NULLABLE:
case NULLIF:
case NULLS:
case NUMBER:
case OBJECT:
case OCTET_LENGTH:
case OCTETS:
case OPTION:
case OPTIONS:
case ORDERING:
case ORDINALITY:
case OTHERS:
case OUTPUT:
case OVERLAY:
case OVERRIDING:
case PAD:
case PARAMETER_MODE:
case PARAMETER_NAME:
case PARAMETER_ORDINAL_POSITION:
case PARAMETER_SPECIFIC_CATALOG:
case PARAMETER_SPECIFIC_NAME:
case PARAMETER_SPECIFIC_SCHEMA:
case PARTIAL:
case PASCAL:
case PASSING:
case PASSTHROUGH:
case PAST:
case PATH:
case PERCENT_RANK:
case PERIOD:
case PLACING:
case PLAN:
case PLI:
case POSITION:
case POWER:
case PRECEDING:
case PRESERVE:
case PREV:
case PRIOR:
case PRIVILEGES:
case PUBLIC:
case QUARTER:
case RANK:
case READ:
case REGR_COUNT:
case REGR_SXX:
case REGR_SYY:
case RELATIVE:
case REPEATABLE:
case REPLACE:
case RESPECT:
case RESTART:
case RESTRICT:
case RETURNED_CARDINALITY:
case RETURNED_LENGTH:
case RETURNED_OCTET_LENGTH:
case RETURNED_SQLSTATE:
case RETURNING:
case RIGHT:
case ROLE:
case ROUTINE:
case ROUTINE_CATALOG:
case ROUTINE_NAME:
case ROUTINE_SCHEMA:
case ROW:
case ROW_COUNT:
case ROW_NUMBER:
case RUNNING:
case SCALAR:
case SCALE:
case SCHEMA:
case SCHEMA_NAME:
case SCOPE_CATALOGS:
case SCOPE_NAME:
case SCOPE_SCHEMA:
case SECOND:
case SECTION:
case SECURITY:
case SELECT:
case SELF:
case SEQUENCE:
case SERIALIZABLE:
case SERVER:
case SERVER_NAME:
case SESSION:
case SESSION_USER:
case SETS:
case SIMPLE:
case SIZE:
case SOURCE:
case SPACE:
case SPECIFIC:
case SPECIFIC_NAME:
case SQL_BIGINT:
case SQL_BINARY:
case SQL_BIT:
case SQL_BLOB:
case SQL_BOOLEAN:
case SQL_CHAR:
case SQL_CLOB:
case SQL_DATE:
case SQL_DECIMAL:
case SQL_DOUBLE:
case SQL_FLOAT:
case SQL_INTEGER:
case SQL_INTERVAL_DAY:
case SQL_INTERVAL_DAY_TO_HOUR:
case SQL_INTERVAL_DAY_TO_MINUTE:
case SQL_INTERVAL_DAY_TO_SECOND:
case SQL_INTERVAL_HOUR:
case SQL_INTERVAL_HOUR_TO_MINUTE:
case SQL_INTERVAL_HOUR_TO_SECOND:
case SQL_INTERVAL_MINUTE:
case SQL_INTERVAL_MINUTE_TO_SECOND:
case SQL_INTERVAL_MONTH:
case SQL_INTERVAL_SECOND:
case SQL_INTERVAL_YEAR:
case SQL_INTERVAL_YEAR_TO_MONTH:
case SQL_LONGVARBINARY:
case SQL_LONGVARCHAR:
case SQL_LONGVARNCHAR:
case SQL_NCHAR:
case SQL_NCLOB:
case SQL_NUMERIC:
case SQL_NVARCHAR:
case SQL_REAL:
case SQL_SMALLINT:
case SQL_TIME:
case SQL_TIMESTAMP:
case SQL_TINYINT:
case SQL_TSI_DAY:
case SQL_TSI_FRAC_SECOND:
case SQL_TSI_HOUR:
case SQL_TSI_MICROSECOND:
case SQL_TSI_MINUTE:
case SQL_TSI_MONTH:
case SQL_TSI_QUARTER:
case SQL_TSI_SECOND:
case SQL_TSI_WEEK:
case SQL_TSI_YEAR:
case SQL_VARBINARY:
case SQL_VARCHAR:
case SQRT:
case STATE:
case STATEMENT:
case STDDEV_POP:
case STDDEV_SAMP:
case STRUCTURE:
case STYLE:
case SUBCLASS_ORIGIN:
case SUBSTITUTE:
case SUBSTRING:
case SUM:
case SYSTEM_USER:
case TABLE:
case TABLE_NAME:
case TEMPORARY:
case TIES:
case TIME:
case TIMESTAMP:
case TIMESTAMPADD:
case TIMESTAMPDIFF:
case TOP_LEVEL_COUNT:
case TRANSACTION:
case TRANSACTIONS_ACTIVE:
case TRANSACTIONS_COMMITTED:
case TRANSACTIONS_ROLLED_BACK:
case TRANSFORM:
case TRANSFORMS:
case TRANSLATE:
case TRIGGER_CATALOG:
case TRIGGER_NAME:
case TRIGGER_SCHEMA:
case TRIM:
case TRUE:
case TRUNCATE:
case TYPE:
case UNBOUNDED:
case UNCOMMITTED:
case UNCONDITIONAL:
case UNDER:
case UNKNOWN:
case UNNAMED:
case UPPER:
case USAGE:
case USER:
case USER_DEFINED_TYPE_CATALOG:
case USER_DEFINED_TYPE_CODE:
case USER_DEFINED_TYPE_NAME:
case USER_DEFINED_TYPE_SCHEMA:
case UTF8:
case UTF16:
case UTF32:
case VALUES:
case VAR_POP:
case VAR_SAMP:
case VERSION:
case VIEW:
case WEEK:
case WITH:
case WORK:
case WRAPPER:
case WRITE:
case XML:
case YEAR:
case ZONE:
case IF:
case MATERIALIZED:
case STORED:
case VIRTUAL:
case JAR:
case FILE:
case ARCHIVE:
case UNSIGNED_INTEGER_LITERAL:
case APPROX_NUMERIC_LITERAL:
case DECIMAL_NUMERIC_LITERAL:
case BINARY_STRING_LITERAL:
case QUOTED_STRING:
case PREFIXED_STRING_LITERAL:
case UNICODE_STRING_LITERAL:
case LPAREN:
case LBRACE_D:
case LBRACE_T:
case LBRACE_TS:
case LBRACE_FN:
case HOOK:
case PLUS:
case MINUS:
case BRACKET_QUOTED_IDENTIFIER:
case QUOTED_IDENTIFIER:
case BACK_QUOTED_IDENTIFIER:
case IDENTIFIER:
case UNICODE_QUOTED_IDENTIFIER:
stmt = OrderedQueryOrExpr(ExprContext.ACCEPT_QUERY);
break;
case INSERT:
case UPSERT:
stmt = SqlInsert();
break;
case DELETE:
stmt = SqlDelete();
break;
case UPDATE:
stmt = SqlUpdate();
break;
case MERGE:
stmt = SqlMerge();
break;
default:
jj_la1[53] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
{if (true) return stmt;}
throw new Error("Missing return statement in function");
}
/**
* Parses WITH TYPE | WITH IMPLEMENTATION | WITHOUT IMPLEMENTATION modifier for
* EXPLAIN PLAN.
*/
final public SqlExplain.Depth ExplainDepth() throws ParseException {
if (jj_2_6(2)) {
jj_consume_token(WITH);
jj_consume_token(TYPE);
{if (true) return SqlExplain.Depth.TYPE;}
} else {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case WITH:
jj_consume_token(WITH);
jj_consume_token(IMPLEMENTATION);
{if (true) return SqlExplain.Depth.PHYSICAL;}
break;
case WITHOUT:
jj_consume_token(WITHOUT);
jj_consume_token(IMPLEMENTATION);
{if (true) return SqlExplain.Depth.LOGICAL;}
break;
default:
jj_la1[54] = jj_gen;
{if (true) return SqlExplain.Depth.PHYSICAL;}
}
}
throw new Error("Missing return statement in function");
}
/**
* Parses INCLUDING ALL ATTRIBUTES modifier for EXPLAIN PLAN.
*/
final public SqlExplainLevel ExplainDetailLevel() throws ParseException {
SqlExplainLevel level = SqlExplainLevel.EXPPLAN_ATTRIBUTES;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case EXCLUDING:
jj_consume_token(EXCLUDING);
jj_consume_token(ATTRIBUTES);
level = SqlExplainLevel.NO_ATTRIBUTES;
break;
case INCLUDING:
jj_consume_token(INCLUDING);
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case ALL:
jj_consume_token(ALL);
level = SqlExplainLevel.ALL_ATTRIBUTES;
break;
default:
jj_la1[55] = jj_gen;
;
}
jj_consume_token(ATTRIBUTES);
break;
default:
jj_la1[56] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
{if (true) return level;}
throw new Error("Missing return statement in function");
}
/**
* Parses a DESCRIBE statement.
*/
final public SqlNode SqlDescribe() throws ParseException {
final Span s;
final SqlIdentifier table;
final SqlIdentifier column;
final SqlIdentifier id;
final SqlNode stmt;
jj_consume_token(DESCRIBE);
s = span();
if (jj_2_7(2)) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case DATABASE:
jj_consume_token(DATABASE);
break;
case CATALOG:
jj_consume_token(CATALOG);
break;
case SCHEMA:
jj_consume_token(SCHEMA);
break;
default:
jj_la1[57] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
id = CompoundIdentifier();
// DESCRIBE DATABASE and DESCRIBE CATALOG currently do the same as
// DESCRIBE SCHEMA but should be different. See
// [CALCITE-1221] Implement DESCRIBE DATABASE, CATALOG, STATEMENT
{if (true) return new SqlDescribeSchema(s.end(id), id);}
} else if (jj_2_8(2147483647)) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case TABLE:
jj_consume_token(TABLE);
break;
default:
jj_la1[58] = jj_gen;
;
}
table = CompoundIdentifier();
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case A:
case ABSENT:
case ABSOLUTE:
case ACTION:
case ADA:
case ADD:
case ADMIN:
case AFTER:
case ALWAYS:
case APPLY:
case ASC:
case ASSERTION:
case ASSIGNMENT:
case ATTRIBUTE:
case ATTRIBUTES:
case BEFORE:
case BERNOULLI:
case BREADTH:
case C:
case CASCADE:
case CATALOG:
case CATALOG_NAME:
case CENTURY:
case CHAIN:
case CHARACTER_SET_CATALOG:
case CHARACTER_SET_NAME:
case CHARACTER_SET_SCHEMA:
case CHARACTERISTICS:
case CHARACTERS:
case CLASS_ORIGIN:
case COBOL:
case COLLATION:
case COLLATION_CATALOG:
case COLLATION_NAME:
case COLLATION_SCHEMA:
case COLUMN_NAME:
case COMMAND_FUNCTION:
case COMMAND_FUNCTION_CODE:
case COMMITTED:
case CONDITIONAL:
case CONDITION_NUMBER:
case CONNECTION:
case CONNECTION_NAME:
case CONSTRAINT_CATALOG:
case CONSTRAINT_NAME:
case CONSTRAINT_SCHEMA:
case CONSTRAINTS:
case CONSTRUCTOR:
case CONTINUE:
case CURSOR_NAME:
case DATA:
case DATABASE:
case DATETIME_INTERVAL_CODE:
case DATETIME_INTERVAL_PRECISION:
case DECADE:
case DEFAULTS:
case DEFERRABLE:
case DEFERRED:
case DEFINED:
case DEFINER:
case DEGREE:
case DEPTH:
case DERIVED:
case DESC:
case DESCRIPTION:
case DESCRIPTOR:
case DIAGNOSTICS:
case DISPATCH:
case DOMAIN:
case DOW:
case DOY:
case DYNAMIC_FUNCTION:
case DYNAMIC_FUNCTION_CODE:
case ENCODING:
case EPOCH:
case ERROR:
case EXCEPTION:
case EXCLUDE:
case EXCLUDING:
case FINAL:
case FIRST:
case FOLLOWING:
case FORMAT:
case FORTRAN:
case FOUND:
case FRAC_SECOND:
case G:
case GENERAL:
case GENERATED:
case GEOMETRY:
case GO:
case GOTO:
case GRANTED:
case HIERARCHY:
case IGNORE:
case IMMEDIATE:
case IMMEDIATELY:
case IMPLEMENTATION:
case INCLUDING:
case INCREMENT:
case INITIALLY:
case INPUT:
case INSTANCE:
case INSTANTIABLE:
case INVOKER:
case ISODOW:
case ISOYEAR:
case ISOLATION:
case JAVA:
case JSON:
case K:
case KEY:
case KEY_MEMBER:
case KEY_TYPE:
case LABEL:
case LAST:
case LENGTH:
case LEVEL:
case LIBRARY:
case LOCATOR:
case M:
case MAP:
case MATCHED:
case MAXVALUE:
case MESSAGE_LENGTH:
case MESSAGE_OCTET_LENGTH:
case MESSAGE_TEXT:
case MICROSECOND:
case MILLISECOND:
case MILLENNIUM:
case MINVALUE:
case MORE_:
case MUMPS:
case NAME:
case NAMES:
case NANOSECOND:
case NESTING:
case NORMALIZED:
case NULLABLE:
case NULLS:
case NUMBER:
case OBJECT:
case OCTETS:
case OPTION:
case OPTIONS:
case ORDERING:
case ORDINALITY:
case OTHERS:
case OUTPUT:
case OVERRIDING:
case PAD:
case PARAMETER_MODE:
case PARAMETER_NAME:
case PARAMETER_ORDINAL_POSITION:
case PARAMETER_SPECIFIC_CATALOG:
case PARAMETER_SPECIFIC_NAME:
case PARAMETER_SPECIFIC_SCHEMA:
case PARTIAL:
case PASCAL:
case PASSING:
case PASSTHROUGH:
case PAST:
case PATH:
case PLACING:
case PLAN:
case PLI:
case PRECEDING:
case PRESERVE:
case PRIOR:
case PRIVILEGES:
case PUBLIC:
case QUARTER:
case READ:
case RELATIVE:
case REPEATABLE:
case REPLACE:
case RESPECT:
case RESTART:
case RESTRICT:
case RETURNED_CARDINALITY:
case RETURNED_LENGTH:
case RETURNED_OCTET_LENGTH:
case RETURNED_SQLSTATE:
case RETURNING:
case ROLE:
case ROUTINE:
case ROUTINE_CATALOG:
case ROUTINE_NAME:
case ROUTINE_SCHEMA:
case ROW_COUNT:
case SCALAR:
case SCALE:
case SCHEMA:
case SCHEMA_NAME:
case SCOPE_CATALOGS:
case SCOPE_NAME:
case SCOPE_SCHEMA:
case SECTION:
case SECURITY:
case SELF:
case SEQUENCE:
case SERIALIZABLE:
case SERVER:
case SERVER_NAME:
case SESSION:
case SETS:
case SIMPLE:
case SIZE:
case SOURCE:
case SPACE:
case SPECIFIC_NAME:
case SQL_BIGINT:
case SQL_BINARY:
case SQL_BIT:
case SQL_BLOB:
case SQL_BOOLEAN:
case SQL_CHAR:
case SQL_CLOB:
case SQL_DATE:
case SQL_DECIMAL:
case SQL_DOUBLE:
case SQL_FLOAT:
case SQL_INTEGER:
case SQL_INTERVAL_DAY:
case SQL_INTERVAL_DAY_TO_HOUR:
case SQL_INTERVAL_DAY_TO_MINUTE:
case SQL_INTERVAL_DAY_TO_SECOND:
case SQL_INTERVAL_HOUR:
case SQL_INTERVAL_HOUR_TO_MINUTE:
case SQL_INTERVAL_HOUR_TO_SECOND:
case SQL_INTERVAL_MINUTE:
case SQL_INTERVAL_MINUTE_TO_SECOND:
case SQL_INTERVAL_MONTH:
case SQL_INTERVAL_SECOND:
case SQL_INTERVAL_YEAR:
case SQL_INTERVAL_YEAR_TO_MONTH:
case SQL_LONGVARBINARY:
case SQL_LONGVARCHAR:
case SQL_LONGVARNCHAR:
case SQL_NCHAR:
case SQL_NCLOB:
case SQL_NUMERIC:
case SQL_NVARCHAR:
case SQL_REAL:
case SQL_SMALLINT:
case SQL_TIME:
case SQL_TIMESTAMP:
case SQL_TINYINT:
case SQL_TSI_DAY:
case SQL_TSI_FRAC_SECOND:
case SQL_TSI_HOUR:
case SQL_TSI_MICROSECOND:
case SQL_TSI_MINUTE:
case SQL_TSI_MONTH:
case SQL_TSI_QUARTER:
case SQL_TSI_SECOND:
case SQL_TSI_WEEK:
case SQL_TSI_YEAR:
case SQL_VARBINARY:
case SQL_VARCHAR:
case STATE:
case STATEMENT:
case STRUCTURE:
case STYLE:
case SUBCLASS_ORIGIN:
case SUBSTITUTE:
case TABLE_NAME:
case TEMPORARY:
case TIES:
case TIMESTAMPADD:
case TIMESTAMPDIFF:
case TOP_LEVEL_COUNT:
case TRANSACTION:
case TRANSACTIONS_ACTIVE:
case TRANSACTIONS_COMMITTED:
case TRANSACTIONS_ROLLED_BACK:
case TRANSFORM:
case TRANSFORMS:
case TRIGGER_CATALOG:
case TRIGGER_NAME:
case TRIGGER_SCHEMA:
case TYPE:
case UNBOUNDED:
case UNCOMMITTED:
case UNCONDITIONAL:
case UNDER:
case UNNAMED:
case USAGE:
case USER_DEFINED_TYPE_CATALOG:
case USER_DEFINED_TYPE_CODE:
case USER_DEFINED_TYPE_NAME:
case USER_DEFINED_TYPE_SCHEMA:
case UTF8:
case UTF16:
case UTF32:
case VERSION:
case VIEW:
case WEEK:
case WORK:
case WRAPPER:
case WRITE:
case XML:
case ZONE:
case IF:
case MATERIALIZED:
case STORED:
case VIRTUAL:
case JAR:
case FILE:
case ARCHIVE:
case BRACKET_QUOTED_IDENTIFIER:
case QUOTED_IDENTIFIER:
case BACK_QUOTED_IDENTIFIER:
case IDENTIFIER:
case UNICODE_QUOTED_IDENTIFIER:
column = SimpleIdentifier();
break;
default:
jj_la1[59] = jj_gen;
E();
column = null;
}
{if (true) return new SqlDescribeTable(s.add(table).addIf(column).pos(),
table, column);}
} else {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case A:
case ABS:
case ABSENT:
case ABSOLUTE:
case ACTION:
case ADA:
case ADD:
case ADMIN:
case AFTER:
case ALWAYS:
case APPLY:
case ARRAY:
case ASC:
case ASSERTION:
case ASSIGNMENT:
case ATTRIBUTE:
case ATTRIBUTES:
case AVG:
case BEFORE:
case BERNOULLI:
case BREADTH:
case C:
case CARDINALITY:
case CASCADE:
case CASE:
case CAST:
case CATALOG:
case CATALOG_NAME:
case CEIL:
case CEILING:
case CENTURY:
case CHAIN:
case CHAR_LENGTH:
case CHARACTER_LENGTH:
case CHARACTER_SET_CATALOG:
case CHARACTER_SET_NAME:
case CHARACTER_SET_SCHEMA:
case CHARACTERISTICS:
case CHARACTERS:
case CLASSIFIER:
case CLASS_ORIGIN:
case COALESCE:
case COBOL:
case COLLATION:
case COLLATION_CATALOG:
case COLLATION_NAME:
case COLLATION_SCHEMA:
case COLLECT:
case COLUMN_NAME:
case COMMAND_FUNCTION:
case COMMAND_FUNCTION_CODE:
case COMMITTED:
case CONDITIONAL:
case CONDITION_NUMBER:
case CONNECTION:
case CONNECTION_NAME:
case CONSTRAINT_CATALOG:
case CONSTRAINT_NAME:
case CONSTRAINT_SCHEMA:
case CONSTRAINTS:
case CONSTRUCTOR:
case CONTINUE:
case CONVERT:
case COUNT:
case COVAR_POP:
case COVAR_SAMP:
case CUME_DIST:
case CURRENT:
case CURRENT_CATALOG:
case CURRENT_DATE:
case CURRENT_DEFAULT_TRANSFORM_GROUP:
case CURRENT_PATH:
case CURRENT_ROLE:
case CURRENT_SCHEMA:
case CURRENT_TIME:
case CURRENT_TIMESTAMP:
case CURRENT_USER:
case CURSOR:
case CURSOR_NAME:
case DATA:
case DATABASE:
case DATE:
case DATETIME_INTERVAL_CODE:
case DATETIME_INTERVAL_PRECISION:
case DECADE:
case DEFAULTS:
case DEFERRABLE:
case DEFERRED:
case DEFINED:
case DEFINER:
case DEGREE:
case DELETE:
case DENSE_RANK:
case DEPTH:
case DERIVED:
case DESC:
case DESCRIPTION:
case DESCRIPTOR:
case DIAGNOSTICS:
case DISPATCH:
case DOMAIN:
case DOW:
case DOY:
case DYNAMIC_FUNCTION:
case DYNAMIC_FUNCTION_CODE:
case ELEMENT:
case ENCODING:
case EPOCH:
case ERROR:
case EXCEPTION:
case EXCLUDE:
case EXCLUDING:
case EXISTS:
case EXP:
case EXTRACT:
case FALSE:
case FINAL:
case FIRST:
case FIRST_VALUE:
case FLOOR:
case FOLLOWING:
case FORMAT:
case FORTRAN:
case FOUND:
case FRAC_SECOND:
case FUSION:
case G:
case GENERAL:
case GENERATED:
case GEOMETRY:
case GO:
case GOTO:
case GRANTED:
case GROUPING:
case HIERARCHY:
case HOUR:
case IGNORE:
case IMMEDIATE:
case IMMEDIATELY:
case IMPLEMENTATION:
case INCLUDING:
case INCREMENT:
case INITIALLY:
case INPUT:
case INSERT:
case INSTANCE:
case INSTANTIABLE:
case INTERVAL:
case INVOKER:
case ISODOW:
case ISOYEAR:
case ISOLATION:
case JAVA:
case JSON:
case JSON_ARRAY:
case JSON_ARRAYAGG:
case JSON_EXISTS:
case JSON_OBJECT:
case JSON_OBJECTAGG:
case JSON_QUERY:
case JSON_VALUE:
case K:
case KEY:
case KEY_MEMBER:
case KEY_TYPE:
case LABEL:
case LAG:
case LAST:
case LAST_VALUE:
case LEAD:
case LEFT:
case LENGTH:
case LEVEL:
case LIBRARY:
case LN:
case LOCALTIME:
case LOCALTIMESTAMP:
case LOCATOR:
case LOWER:
case M:
case MAP:
case MATCHED:
case MATCH_NUMBER:
case MAX:
case MAXVALUE:
case MERGE:
case MESSAGE_LENGTH:
case MESSAGE_OCTET_LENGTH:
case MESSAGE_TEXT:
case MICROSECOND:
case MILLISECOND:
case MILLENNIUM:
case MIN:
case MINUTE:
case MINVALUE:
case MOD:
case MONTH:
case MORE_:
case MULTISET:
case MUMPS:
case NAME:
case NAMES:
case NANOSECOND:
case NESTING:
case NEW:
case NEXT:
case NORMALIZED:
case NOT:
case NTH_VALUE:
case NTILE:
case NULL:
case NULLABLE:
case NULLIF:
case NULLS:
case NUMBER:
case OBJECT:
case OCTET_LENGTH:
case OCTETS:
case OPTION:
case OPTIONS:
case ORDERING:
case ORDINALITY:
case OTHERS:
case OUTPUT:
case OVERLAY:
case OVERRIDING:
case PAD:
case PARAMETER_MODE:
case PARAMETER_NAME:
case PARAMETER_ORDINAL_POSITION:
case PARAMETER_SPECIFIC_CATALOG:
case PARAMETER_SPECIFIC_NAME:
case PARAMETER_SPECIFIC_SCHEMA:
case PARTIAL:
case PASCAL:
case PASSING:
case PASSTHROUGH:
case PAST:
case PATH:
case PERCENT_RANK:
case PERIOD:
case PLACING:
case PLAN:
case PLI:
case POSITION:
case POWER:
case PRECEDING:
case PRESERVE:
case PREV:
case PRIOR:
case PRIVILEGES:
case PUBLIC:
case QUARTER:
case RANK:
case READ:
case REGR_COUNT:
case REGR_SXX:
case REGR_SYY:
case RELATIVE:
case REPEATABLE:
case REPLACE:
case RESPECT:
case RESTART:
case RESTRICT:
case RETURNED_CARDINALITY:
case RETURNED_LENGTH:
case RETURNED_OCTET_LENGTH:
case RETURNED_SQLSTATE:
case RETURNING:
case RIGHT:
case ROLE:
case ROUTINE:
case ROUTINE_CATALOG:
case ROUTINE_NAME:
case ROUTINE_SCHEMA:
case ROW:
case ROW_COUNT:
case ROW_NUMBER:
case RUNNING:
case SCALAR:
case SCALE:
case SCHEMA:
case SCHEMA_NAME:
case SCOPE_CATALOGS:
case SCOPE_NAME:
case SCOPE_SCHEMA:
case SECOND:
case SECTION:
case SECURITY:
case SELECT:
case SELF:
case SEQUENCE:
case SERIALIZABLE:
case SERVER:
case SERVER_NAME:
case SESSION:
case SESSION_USER:
case SETS:
case SIMPLE:
case SIZE:
case SOURCE:
case SPACE:
case SPECIFIC:
case SPECIFIC_NAME:
case SQL_BIGINT:
case SQL_BINARY:
case SQL_BIT:
case SQL_BLOB:
case SQL_BOOLEAN:
case SQL_CHAR:
case SQL_CLOB:
case SQL_DATE:
case SQL_DECIMAL:
case SQL_DOUBLE:
case SQL_FLOAT:
case SQL_INTEGER:
case SQL_INTERVAL_DAY:
case SQL_INTERVAL_DAY_TO_HOUR:
case SQL_INTERVAL_DAY_TO_MINUTE:
case SQL_INTERVAL_DAY_TO_SECOND:
case SQL_INTERVAL_HOUR:
case SQL_INTERVAL_HOUR_TO_MINUTE:
case SQL_INTERVAL_HOUR_TO_SECOND:
case SQL_INTERVAL_MINUTE:
case SQL_INTERVAL_MINUTE_TO_SECOND:
case SQL_INTERVAL_MONTH:
case SQL_INTERVAL_SECOND:
case SQL_INTERVAL_YEAR:
case SQL_INTERVAL_YEAR_TO_MONTH:
case SQL_LONGVARBINARY:
case SQL_LONGVARCHAR:
case SQL_LONGVARNCHAR:
case SQL_NCHAR:
case SQL_NCLOB:
case SQL_NUMERIC:
case SQL_NVARCHAR:
case SQL_REAL:
case SQL_SMALLINT:
case SQL_TIME:
case SQL_TIMESTAMP:
case SQL_TINYINT:
case SQL_TSI_DAY:
case SQL_TSI_FRAC_SECOND:
case SQL_TSI_HOUR:
case SQL_TSI_MICROSECOND:
case SQL_TSI_MINUTE:
case SQL_TSI_MONTH:
case SQL_TSI_QUARTER:
case SQL_TSI_SECOND:
case SQL_TSI_WEEK:
case SQL_TSI_YEAR:
case SQL_VARBINARY:
case SQL_VARCHAR:
case SQRT:
case STATE:
case STATEMENT:
case STDDEV_POP:
case STDDEV_SAMP:
case STRUCTURE:
case STYLE:
case SUBCLASS_ORIGIN:
case SUBSTITUTE:
case SUBSTRING:
case SUM:
case SYSTEM_USER:
case TABLE:
case TABLE_NAME:
case TEMPORARY:
case TIES:
case TIME:
case TIMESTAMP:
case TIMESTAMPADD:
case TIMESTAMPDIFF:
case TOP_LEVEL_COUNT:
case TRANSACTION:
case TRANSACTIONS_ACTIVE:
case TRANSACTIONS_COMMITTED:
case TRANSACTIONS_ROLLED_BACK:
case TRANSFORM:
case TRANSFORMS:
case TRANSLATE:
case TRIGGER_CATALOG:
case TRIGGER_NAME:
case TRIGGER_SCHEMA:
case TRIM:
case TRUE:
case TRUNCATE:
case TYPE:
case UNBOUNDED:
case UNCOMMITTED:
case UNCONDITIONAL:
case UNDER:
case UNKNOWN:
case UNNAMED:
case UPDATE:
case UPPER:
case UPSERT:
case USAGE:
case USER:
case USER_DEFINED_TYPE_CATALOG:
case USER_DEFINED_TYPE_CODE:
case USER_DEFINED_TYPE_NAME:
case USER_DEFINED_TYPE_SCHEMA:
case UTF8:
case UTF16:
case UTF32:
case VALUES:
case VAR_POP:
case VAR_SAMP:
case VERSION:
case VIEW:
case WEEK:
case WITH:
case WORK:
case WRAPPER:
case WRITE:
case XML:
case YEAR:
case ZONE:
case IF:
case MATERIALIZED:
case STORED:
case VIRTUAL:
case JAR:
case FILE:
case ARCHIVE:
case UNSIGNED_INTEGER_LITERAL:
case APPROX_NUMERIC_LITERAL:
case DECIMAL_NUMERIC_LITERAL:
case BINARY_STRING_LITERAL:
case QUOTED_STRING:
case PREFIXED_STRING_LITERAL:
case UNICODE_STRING_LITERAL:
case LPAREN:
case LBRACE_D:
case LBRACE_T:
case LBRACE_TS:
case LBRACE_FN:
case HOOK:
case PLUS:
case MINUS:
case BRACKET_QUOTED_IDENTIFIER:
case QUOTED_IDENTIFIER:
case BACK_QUOTED_IDENTIFIER:
case IDENTIFIER:
case UNICODE_QUOTED_IDENTIFIER:
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case STATEMENT:
jj_consume_token(STATEMENT);
break;
default:
jj_la1[60] = jj_gen;
;
}
stmt = SqlQueryOrDml();
// DESCRIBE STATEMENT currently does the same as EXPLAIN. See
// [CALCITE-1221] Implement DESCRIBE DATABASE, CATALOG, STATEMENT
final SqlExplainLevel detailLevel = SqlExplainLevel.EXPPLAN_ATTRIBUTES;
final SqlExplain.Depth depth = SqlExplain.Depth.PHYSICAL;
final SqlExplainFormat format = SqlExplainFormat.TEXT;
{if (true) return new SqlExplain(s.end(stmt),
stmt,
detailLevel.symbol(SqlParserPos.ZERO),
depth.symbol(SqlParserPos.ZERO),
format.symbol(SqlParserPos.ZERO),
nDynamicParams);}
break;
default:
jj_la1[61] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
}
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 SqlNode NamedRoutineCall(SqlFunctionCategory routineType,
ExprContext exprContext) throws ParseException {
SqlIdentifier name;
final List list = new ArrayList();
final Span s;
name = CompoundIdentifier();
s = span();
jj_consume_token(LPAREN);
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case A:
case ABS:
case ABSENT:
case ABSOLUTE:
case ACTION:
case ADA:
case ADD:
case ADMIN:
case AFTER:
case ALWAYS:
case APPLY:
case ARRAY:
case ASC:
case ASSERTION:
case ASSIGNMENT:
case ATTRIBUTE:
case ATTRIBUTES:
case AVG:
case BEFORE:
case BERNOULLI:
case BREADTH:
case C:
case CARDINALITY:
case CASCADE:
case CASE:
case CAST:
case CATALOG:
case CATALOG_NAME:
case CEIL:
case CEILING:
case CENTURY:
case CHAIN:
case CHAR_LENGTH:
case CHARACTER_LENGTH:
case CHARACTER_SET_CATALOG:
case CHARACTER_SET_NAME:
case CHARACTER_SET_SCHEMA:
case CHARACTERISTICS:
case CHARACTERS:
case CLASSIFIER:
case CLASS_ORIGIN:
case COALESCE:
case COBOL:
case COLLATION:
case COLLATION_CATALOG:
case COLLATION_NAME:
case COLLATION_SCHEMA:
case COLLECT:
case COLUMN_NAME:
case COMMAND_FUNCTION:
case COMMAND_FUNCTION_CODE:
case COMMITTED:
case CONDITIONAL:
case CONDITION_NUMBER:
case CONNECTION:
case CONNECTION_NAME:
case CONSTRAINT_CATALOG:
case CONSTRAINT_NAME:
case CONSTRAINT_SCHEMA:
case CONSTRAINTS:
case CONSTRUCTOR:
case CONTINUE:
case CONVERT:
case COUNT:
case COVAR_POP:
case COVAR_SAMP:
case CUME_DIST:
case CURRENT:
case CURRENT_CATALOG:
case CURRENT_DATE:
case CURRENT_DEFAULT_TRANSFORM_GROUP:
case CURRENT_PATH:
case CURRENT_ROLE:
case CURRENT_SCHEMA:
case CURRENT_TIME:
case CURRENT_TIMESTAMP:
case CURRENT_USER:
case CURSOR:
case CURSOR_NAME:
case DATA:
case DATABASE:
case DATE:
case DATETIME_INTERVAL_CODE:
case DATETIME_INTERVAL_PRECISION:
case DECADE:
case DEFAULT_:
case DEFAULTS:
case DEFERRABLE:
case DEFERRED:
case DEFINED:
case DEFINER:
case DEGREE:
case DENSE_RANK:
case DEPTH:
case DERIVED:
case DESC:
case DESCRIPTION:
case DESCRIPTOR:
case DIAGNOSTICS:
case DISPATCH:
case DOMAIN:
case DOW:
case DOY:
case DYNAMIC_FUNCTION:
case DYNAMIC_FUNCTION_CODE:
case ELEMENT:
case ENCODING:
case EPOCH:
case ERROR:
case EXCEPTION:
case EXCLUDE:
case EXCLUDING:
case EXISTS:
case EXP:
case EXTRACT:
case FALSE:
case FINAL:
case FIRST:
case FIRST_VALUE:
case FLOOR:
case FOLLOWING:
case FORMAT:
case FORTRAN:
case FOUND:
case FRAC_SECOND:
case FUSION:
case G:
case GENERAL:
case GENERATED:
case GEOMETRY:
case GO:
case GOTO:
case GRANTED:
case GROUPING:
case HIERARCHY:
case HOUR:
case IGNORE:
case IMMEDIATE:
case IMMEDIATELY:
case IMPLEMENTATION:
case INCLUDING:
case INCREMENT:
case INITIALLY:
case INPUT:
case INSTANCE:
case INSTANTIABLE:
case INTERVAL:
case INVOKER:
case ISODOW:
case ISOYEAR:
case ISOLATION:
case JAVA:
case JSON:
case JSON_ARRAY:
case JSON_ARRAYAGG:
case JSON_EXISTS:
case JSON_OBJECT:
case JSON_OBJECTAGG:
case JSON_QUERY:
case JSON_VALUE:
case K:
case KEY:
case KEY_MEMBER:
case KEY_TYPE:
case LABEL:
case LAG:
case LAST:
case LAST_VALUE:
case LEAD:
case LEFT:
case LENGTH:
case LEVEL:
case LIBRARY:
case LN:
case LOCALTIME:
case LOCALTIMESTAMP:
case LOCATOR:
case LOWER:
case M:
case MAP:
case MATCHED:
case MATCH_NUMBER:
case MAX:
case MAXVALUE:
case MESSAGE_LENGTH:
case MESSAGE_OCTET_LENGTH:
case MESSAGE_TEXT:
case MICROSECOND:
case MILLISECOND:
case MILLENNIUM:
case MIN:
case MINUTE:
case MINVALUE:
case MOD:
case MONTH:
case MORE_:
case MULTISET:
case MUMPS:
case NAME:
case NAMES:
case NANOSECOND:
case NESTING:
case NEW:
case NEXT:
case NORMALIZED:
case NOT:
case NTH_VALUE:
case NTILE:
case NULL:
case NULLABLE:
case NULLIF:
case NULLS:
case NUMBER:
case OBJECT:
case OCTET_LENGTH:
case OCTETS:
case OPTION:
case OPTIONS:
case ORDERING:
case ORDINALITY:
case OTHERS:
case OUTPUT:
case OVERLAY:
case OVERRIDING:
case PAD:
case PARAMETER_MODE:
case PARAMETER_NAME:
case PARAMETER_ORDINAL_POSITION:
case PARAMETER_SPECIFIC_CATALOG:
case PARAMETER_SPECIFIC_NAME:
case PARAMETER_SPECIFIC_SCHEMA:
case PARTIAL:
case PASCAL:
case PASSING:
case PASSTHROUGH:
case PAST:
case PATH:
case PERCENT_RANK:
case PERIOD:
case PLACING:
case PLAN:
case PLI:
case POSITION:
case POWER:
case PRECEDING:
case PRESERVE:
case PREV:
case PRIOR:
case PRIVILEGES:
case PUBLIC:
case QUARTER:
case RANK:
case READ:
case REGR_COUNT:
case REGR_SXX:
case REGR_SYY:
case RELATIVE:
case REPEATABLE:
case REPLACE:
case RESPECT:
case RESTART:
case RESTRICT:
case RETURNED_CARDINALITY:
case RETURNED_LENGTH:
case RETURNED_OCTET_LENGTH:
case RETURNED_SQLSTATE:
case RETURNING:
case RIGHT:
case ROLE:
case ROUTINE:
case ROUTINE_CATALOG:
case ROUTINE_NAME:
case ROUTINE_SCHEMA:
case ROW:
case ROW_COUNT:
case ROW_NUMBER:
case RUNNING:
case SCALAR:
case SCALE:
case SCHEMA:
case SCHEMA_NAME:
case SCOPE_CATALOGS:
case SCOPE_NAME:
case SCOPE_SCHEMA:
case SECOND:
case SECTION:
case SECURITY:
case SELECT:
case SELF:
case SEQUENCE:
case SERIALIZABLE:
case SERVER:
case SERVER_NAME:
case SESSION:
case SESSION_USER:
case SETS:
case SIMPLE:
case SIZE:
case SOURCE:
case SPACE:
case SPECIFIC:
case SPECIFIC_NAME:
case SQL_BIGINT:
case SQL_BINARY:
case SQL_BIT:
case SQL_BLOB:
case SQL_BOOLEAN:
case SQL_CHAR:
case SQL_CLOB:
case SQL_DATE:
case SQL_DECIMAL:
case SQL_DOUBLE:
case SQL_FLOAT:
case SQL_INTEGER:
case SQL_INTERVAL_DAY:
case SQL_INTERVAL_DAY_TO_HOUR:
case SQL_INTERVAL_DAY_TO_MINUTE:
case SQL_INTERVAL_DAY_TO_SECOND:
case SQL_INTERVAL_HOUR:
case SQL_INTERVAL_HOUR_TO_MINUTE:
case SQL_INTERVAL_HOUR_TO_SECOND:
case SQL_INTERVAL_MINUTE:
case SQL_INTERVAL_MINUTE_TO_SECOND:
case SQL_INTERVAL_MONTH:
case SQL_INTERVAL_SECOND:
case SQL_INTERVAL_YEAR:
case SQL_INTERVAL_YEAR_TO_MONTH:
case SQL_LONGVARBINARY:
case SQL_LONGVARCHAR:
case SQL_LONGVARNCHAR:
case SQL_NCHAR:
case SQL_NCLOB:
case SQL_NUMERIC:
case SQL_NVARCHAR:
case SQL_REAL:
case SQL_SMALLINT:
case SQL_TIME:
case SQL_TIMESTAMP:
case SQL_TINYINT:
case SQL_TSI_DAY:
case SQL_TSI_FRAC_SECOND:
case SQL_TSI_HOUR:
case SQL_TSI_MICROSECOND:
case SQL_TSI_MINUTE:
case SQL_TSI_MONTH:
case SQL_TSI_QUARTER:
case SQL_TSI_SECOND:
case SQL_TSI_WEEK:
case SQL_TSI_YEAR:
case SQL_VARBINARY:
case SQL_VARCHAR:
case SQRT:
case STATE:
case STATEMENT:
case STDDEV_POP:
case STDDEV_SAMP:
case STRUCTURE:
case STYLE:
case SUBCLASS_ORIGIN:
case SUBSTITUTE:
case SUBSTRING:
case SUM:
case SYSTEM_USER:
case TABLE:
case TABLE_NAME:
case TEMPORARY:
case TIES:
case TIME:
case TIMESTAMP:
case TIMESTAMPADD:
case TIMESTAMPDIFF:
case TOP_LEVEL_COUNT:
case TRANSACTION:
case TRANSACTIONS_ACTIVE:
case TRANSACTIONS_COMMITTED:
case TRANSACTIONS_ROLLED_BACK:
case TRANSFORM:
case TRANSFORMS:
case TRANSLATE:
case TRIGGER_CATALOG:
case TRIGGER_NAME:
case TRIGGER_SCHEMA:
case TRIM:
case TRUE:
case TRUNCATE:
case TYPE:
case UNBOUNDED:
case UNCOMMITTED:
case UNCONDITIONAL:
case UNDER:
case UNKNOWN:
case UNNAMED:
case UPPER:
case USAGE:
case USER:
case USER_DEFINED_TYPE_CATALOG:
case USER_DEFINED_TYPE_CODE:
case USER_DEFINED_TYPE_NAME:
case USER_DEFINED_TYPE_SCHEMA:
case UTF8:
case UTF16:
case UTF32:
case VALUES:
case VAR_POP:
case VAR_SAMP:
case VERSION:
case VIEW:
case WEEK:
case WITH:
case WORK:
case WRAPPER:
case WRITE:
case XML:
case YEAR:
case ZONE:
case IF:
case MATERIALIZED:
case STORED:
case VIRTUAL:
case JAR:
case FILE:
case ARCHIVE:
case UNSIGNED_INTEGER_LITERAL:
case APPROX_NUMERIC_LITERAL:
case DECIMAL_NUMERIC_LITERAL:
case BINARY_STRING_LITERAL:
case QUOTED_STRING:
case PREFIXED_STRING_LITERAL:
case UNICODE_STRING_LITERAL:
case LPAREN:
case LBRACE_D:
case LBRACE_T:
case LBRACE_TS:
case LBRACE_FN:
case HOOK:
case PLUS:
case MINUS:
case BRACKET_QUOTED_IDENTIFIER:
case QUOTED_IDENTIFIER:
case BACK_QUOTED_IDENTIFIER:
case IDENTIFIER:
case UNICODE_QUOTED_IDENTIFIER:
Arg0(list, exprContext);
label_9:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case COMMA:
;
break;
default:
jj_la1[62] = jj_gen;
break label_9;
}
jj_consume_token(COMMA);
// a comma-list can't appear where only a query is expected
checkNonQueryExpression(exprContext);
Arg(list, exprContext);
}
break;
default:
jj_la1[63] = jj_gen;
;
}
jj_consume_token(RPAREN);
{if (true) return createCall(name, s.end(this), routineType, null, list);}
throw new Error("Missing return statement in function");
}
/**
* Parses an INSERT statement.
*/
final public SqlNode SqlInsert() throws ParseException {
final List keywords = new ArrayList();
final SqlNodeList keywordList;
SqlNode table;
SqlNodeList extendList = null;
SqlNode source;
SqlNodeList columnList = null;
final Span s;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case INSERT:
jj_consume_token(INSERT);
break;
case UPSERT:
jj_consume_token(UPSERT);
keywords.add(SqlInsertKeyword.UPSERT.symbol(getPos()));
break;
default:
jj_la1[64] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
s = span();
SqlInsertKeywords(keywords);
keywordList = new SqlNodeList(keywords, s.addAll(keywords).pos());
jj_consume_token(INTO);
table = CompoundIdentifier();
if (jj_2_9(5)) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case EXTEND:
jj_consume_token(EXTEND);
break;
default:
jj_la1[65] = jj_gen;
;
}
extendList = ExtendList();
table = extend(table, extendList);
} else {
;
}
if (jj_2_10(2)) {
final Pair p;
p = ParenthesizedCompoundIdentifierList();
if (p.right.size() > 0) {
table = extend(table, p.right);
}
if (p.left.size() > 0) {
columnList = p.left;
}
} else {
;
}
source = OrderedQueryOrExpr(ExprContext.ACCEPT_QUERY);
{if (true) return new SqlInsert(s.end(source), keywordList, table, source,
columnList);}
throw new Error("Missing return statement in function");
}
/*
* Abstract production:
*
* void SqlInsertKeywords(List keywords)
*
* Parses dialect-specific keywords immediately following the INSERT keyword.
*/
/**
* Parses a DELETE statement.
*/
final public SqlNode SqlDelete() throws ParseException {
SqlNode table;
SqlNodeList extendList = null;
SqlIdentifier alias = null;
final SqlNode condition;
final Span s;
jj_consume_token(DELETE);
s = span();
jj_consume_token(FROM);
table = CompoundIdentifier();
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case EXTEND:
case LPAREN:
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case EXTEND:
jj_consume_token(EXTEND);
break;
default:
jj_la1[66] = jj_gen;
;
}
extendList = ExtendList();
table = extend(table, extendList);
break;
default:
jj_la1[67] = jj_gen;
;
}
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case A:
case ABSENT:
case ABSOLUTE:
case ACTION:
case ADA:
case ADD:
case ADMIN:
case AFTER:
case ALWAYS:
case APPLY:
case AS:
case ASC:
case ASSERTION:
case ASSIGNMENT:
case ATTRIBUTE:
case ATTRIBUTES:
case BEFORE:
case BERNOULLI:
case BREADTH:
case C:
case CASCADE:
case CATALOG:
case CATALOG_NAME:
case CENTURY:
case CHAIN:
case CHARACTER_SET_CATALOG:
case CHARACTER_SET_NAME:
case CHARACTER_SET_SCHEMA:
case CHARACTERISTICS:
case CHARACTERS:
case CLASS_ORIGIN:
case COBOL:
case COLLATION:
case COLLATION_CATALOG:
case COLLATION_NAME:
case COLLATION_SCHEMA:
case COLUMN_NAME:
case COMMAND_FUNCTION:
case COMMAND_FUNCTION_CODE:
case COMMITTED:
case CONDITIONAL:
case CONDITION_NUMBER:
case CONNECTION:
case CONNECTION_NAME:
case CONSTRAINT_CATALOG:
case CONSTRAINT_NAME:
case CONSTRAINT_SCHEMA:
case CONSTRAINTS:
case CONSTRUCTOR:
case CONTINUE:
case CURSOR_NAME:
case DATA:
case DATABASE:
case DATETIME_INTERVAL_CODE:
case DATETIME_INTERVAL_PRECISION:
case DECADE:
case DEFAULTS:
case DEFERRABLE:
case DEFERRED:
case DEFINED:
case DEFINER:
case DEGREE:
case DEPTH:
case DERIVED:
case DESC:
case DESCRIPTION:
case DESCRIPTOR:
case DIAGNOSTICS:
case DISPATCH:
case DOMAIN:
case DOW:
case DOY:
case DYNAMIC_FUNCTION:
case DYNAMIC_FUNCTION_CODE:
case ENCODING:
case EPOCH:
case ERROR:
case EXCEPTION:
case EXCLUDE:
case EXCLUDING:
case FINAL:
case FIRST:
case FOLLOWING:
case FORMAT:
case FORTRAN:
case FOUND:
case FRAC_SECOND:
case G:
case GENERAL:
case GENERATED:
case GEOMETRY:
case GO:
case GOTO:
case GRANTED:
case HIERARCHY:
case IGNORE:
case IMMEDIATE:
case IMMEDIATELY:
case IMPLEMENTATION:
case INCLUDING:
case INCREMENT:
case INITIALLY:
case INPUT:
case INSTANCE:
case INSTANTIABLE:
case INVOKER:
case ISODOW:
case ISOYEAR:
case ISOLATION:
case JAVA:
case JSON:
case K:
case KEY:
case KEY_MEMBER:
case KEY_TYPE:
case LABEL:
case LAST:
case LENGTH:
case LEVEL:
case LIBRARY:
case LOCATOR:
case M:
case MAP:
case MATCHED:
case MAXVALUE:
case MESSAGE_LENGTH:
case MESSAGE_OCTET_LENGTH:
case MESSAGE_TEXT:
case MICROSECOND:
case MILLISECOND:
case MILLENNIUM:
case MINVALUE:
case MORE_:
case MUMPS:
case NAME:
case NAMES:
case NANOSECOND:
case NESTING:
case NORMALIZED:
case NULLABLE:
case NULLS:
case NUMBER:
case OBJECT:
case OCTETS:
case OPTION:
case OPTIONS:
case ORDERING:
case ORDINALITY:
case OTHERS:
case OUTPUT:
case OVERRIDING:
case PAD:
case PARAMETER_MODE:
case PARAMETER_NAME:
case PARAMETER_ORDINAL_POSITION:
case PARAMETER_SPECIFIC_CATALOG:
case PARAMETER_SPECIFIC_NAME:
case PARAMETER_SPECIFIC_SCHEMA:
case PARTIAL:
case PASCAL:
case PASSING:
case PASSTHROUGH:
case PAST:
case PATH:
case PLACING:
case PLAN:
case PLI:
case PRECEDING:
case PRESERVE:
case PRIOR:
case PRIVILEGES:
case PUBLIC:
case QUARTER:
case READ:
case RELATIVE:
case REPEATABLE:
case REPLACE:
case RESPECT:
case RESTART:
case RESTRICT:
case RETURNED_CARDINALITY:
case RETURNED_LENGTH:
case RETURNED_OCTET_LENGTH:
case RETURNED_SQLSTATE:
case RETURNING:
case ROLE:
case ROUTINE:
case ROUTINE_CATALOG:
case ROUTINE_NAME:
case ROUTINE_SCHEMA:
case ROW_COUNT:
case SCALAR:
case SCALE:
case SCHEMA:
case SCHEMA_NAME:
case SCOPE_CATALOGS:
case SCOPE_NAME:
case SCOPE_SCHEMA:
case SECTION:
case SECURITY:
case SELF:
case SEQUENCE:
case SERIALIZABLE:
case SERVER:
case SERVER_NAME:
case SESSION:
case SETS:
case SIMPLE:
case SIZE:
case SOURCE:
case SPACE:
case SPECIFIC_NAME:
case SQL_BIGINT:
case SQL_BINARY:
case SQL_BIT:
case SQL_BLOB:
case SQL_BOOLEAN:
case SQL_CHAR:
case SQL_CLOB:
case SQL_DATE:
case SQL_DECIMAL:
case SQL_DOUBLE:
case SQL_FLOAT:
case SQL_INTEGER:
case SQL_INTERVAL_DAY:
case SQL_INTERVAL_DAY_TO_HOUR:
case SQL_INTERVAL_DAY_TO_MINUTE:
case SQL_INTERVAL_DAY_TO_SECOND:
case SQL_INTERVAL_HOUR:
case SQL_INTERVAL_HOUR_TO_MINUTE:
case SQL_INTERVAL_HOUR_TO_SECOND:
case SQL_INTERVAL_MINUTE:
case SQL_INTERVAL_MINUTE_TO_SECOND:
case SQL_INTERVAL_MONTH:
case SQL_INTERVAL_SECOND:
case SQL_INTERVAL_YEAR:
case SQL_INTERVAL_YEAR_TO_MONTH:
case SQL_LONGVARBINARY:
case SQL_LONGVARCHAR:
case SQL_LONGVARNCHAR:
case SQL_NCHAR:
case SQL_NCLOB:
case SQL_NUMERIC:
case SQL_NVARCHAR:
case SQL_REAL:
case SQL_SMALLINT:
case SQL_TIME:
case SQL_TIMESTAMP:
case SQL_TINYINT:
case SQL_TSI_DAY:
case SQL_TSI_FRAC_SECOND:
case SQL_TSI_HOUR:
case SQL_TSI_MICROSECOND:
case SQL_TSI_MINUTE:
case SQL_TSI_MONTH:
case SQL_TSI_QUARTER:
case SQL_TSI_SECOND:
case SQL_TSI_WEEK:
case SQL_TSI_YEAR:
case SQL_VARBINARY:
case SQL_VARCHAR:
case STATE:
case STATEMENT:
case STRUCTURE:
case STYLE:
case SUBCLASS_ORIGIN:
case SUBSTITUTE:
case TABLE_NAME:
case TEMPORARY:
case TIES:
case TIMESTAMPADD:
case TIMESTAMPDIFF:
case TOP_LEVEL_COUNT:
case TRANSACTION:
case TRANSACTIONS_ACTIVE:
case TRANSACTIONS_COMMITTED:
case TRANSACTIONS_ROLLED_BACK:
case TRANSFORM:
case TRANSFORMS:
case TRIGGER_CATALOG:
case TRIGGER_NAME:
case TRIGGER_SCHEMA:
case TYPE:
case UNBOUNDED:
case UNCOMMITTED:
case UNCONDITIONAL:
case UNDER:
case UNNAMED:
case USAGE:
case USER_DEFINED_TYPE_CATALOG:
case USER_DEFINED_TYPE_CODE:
case USER_DEFINED_TYPE_NAME:
case USER_DEFINED_TYPE_SCHEMA:
case UTF8:
case UTF16:
case UTF32:
case VERSION:
case VIEW:
case WEEK:
case WORK:
case WRAPPER:
case WRITE:
case XML:
case ZONE:
case IF:
case MATERIALIZED:
case STORED:
case VIRTUAL:
case JAR:
case FILE:
case ARCHIVE:
case BRACKET_QUOTED_IDENTIFIER:
case QUOTED_IDENTIFIER:
case BACK_QUOTED_IDENTIFIER:
case IDENTIFIER:
case UNICODE_QUOTED_IDENTIFIER:
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case AS:
jj_consume_token(AS);
break;
default:
jj_la1[68] = jj_gen;
;
}
alias = SimpleIdentifier();
break;
default:
jj_la1[69] = jj_gen;
;
}
condition = WhereOpt();
{if (true) return new SqlDelete(s.add(table).addIf(extendList).addIf(alias)
.addIf(condition).pos(), table, condition, null, alias);}
throw new Error("Missing return statement in function");
}
/**
* Parses an UPDATE statement.
*/
final public SqlNode SqlUpdate() throws ParseException {
SqlNode table;
SqlNodeList extendList = null;
SqlIdentifier alias = null;
SqlNode condition;
SqlNodeList sourceExpressionList;
SqlNodeList targetColumnList;
SqlIdentifier id;
SqlNode exp;
final Span s;
jj_consume_token(UPDATE);
s = span();
table = CompoundIdentifier();
targetColumnList = new SqlNodeList(s.pos());
sourceExpressionList = new SqlNodeList(s.pos());
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case EXTEND:
case LPAREN:
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case EXTEND:
jj_consume_token(EXTEND);
break;
default:
jj_la1[70] = jj_gen;
;
}
extendList = ExtendList();
table = extend(table, extendList);
break;
default:
jj_la1[71] = jj_gen;
;
}
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case A:
case ABSENT:
case ABSOLUTE:
case ACTION:
case ADA:
case ADD:
case ADMIN:
case AFTER:
case ALWAYS:
case APPLY:
case AS:
case ASC:
case ASSERTION:
case ASSIGNMENT:
case ATTRIBUTE:
case ATTRIBUTES:
case BEFORE:
case BERNOULLI:
case BREADTH:
case C:
case CASCADE:
case CATALOG:
case CATALOG_NAME:
case CENTURY:
case CHAIN:
case CHARACTER_SET_CATALOG:
case CHARACTER_SET_NAME:
case CHARACTER_SET_SCHEMA:
case CHARACTERISTICS:
case CHARACTERS:
case CLASS_ORIGIN:
case COBOL:
case COLLATION:
case COLLATION_CATALOG:
case COLLATION_NAME:
case COLLATION_SCHEMA:
case COLUMN_NAME:
case COMMAND_FUNCTION:
case COMMAND_FUNCTION_CODE:
case COMMITTED:
case CONDITIONAL:
case CONDITION_NUMBER:
case CONNECTION:
case CONNECTION_NAME:
case CONSTRAINT_CATALOG:
case CONSTRAINT_NAME:
case CONSTRAINT_SCHEMA:
case CONSTRAINTS:
case CONSTRUCTOR:
case CONTINUE:
case CURSOR_NAME:
case DATA:
case DATABASE:
case DATETIME_INTERVAL_CODE:
case DATETIME_INTERVAL_PRECISION:
case DECADE:
case DEFAULTS:
case DEFERRABLE:
case DEFERRED:
case DEFINED:
case DEFINER:
case DEGREE:
case DEPTH:
case DERIVED:
case DESC:
case DESCRIPTION:
case DESCRIPTOR:
case DIAGNOSTICS:
case DISPATCH:
case DOMAIN:
case DOW:
case DOY:
case DYNAMIC_FUNCTION:
case DYNAMIC_FUNCTION_CODE:
case ENCODING:
case EPOCH:
case ERROR:
case EXCEPTION:
case EXCLUDE:
case EXCLUDING:
case FINAL:
case FIRST:
case FOLLOWING:
case FORMAT:
case FORTRAN:
case FOUND:
case FRAC_SECOND:
case G:
case GENERAL:
case GENERATED:
case GEOMETRY:
case GO:
case GOTO:
case GRANTED:
case HIERARCHY:
case IGNORE:
case IMMEDIATE:
case IMMEDIATELY:
case IMPLEMENTATION:
case INCLUDING:
case INCREMENT:
case INITIALLY:
case INPUT:
case INSTANCE:
case INSTANTIABLE:
case INVOKER:
case ISODOW:
case ISOYEAR:
case ISOLATION:
case JAVA:
case JSON:
case K:
case KEY:
case KEY_MEMBER:
case KEY_TYPE:
case LABEL:
case LAST:
case LENGTH:
case LEVEL:
case LIBRARY:
case LOCATOR:
case M:
case MAP:
case MATCHED:
case MAXVALUE:
case MESSAGE_LENGTH:
case MESSAGE_OCTET_LENGTH:
case MESSAGE_TEXT:
case MICROSECOND:
case MILLISECOND:
case MILLENNIUM:
case MINVALUE:
case MORE_:
case MUMPS:
case NAME:
case NAMES:
case NANOSECOND:
case NESTING:
case NORMALIZED:
case NULLABLE:
case NULLS:
case NUMBER:
case OBJECT:
case OCTETS:
case OPTION:
case OPTIONS:
case ORDERING:
case ORDINALITY:
case OTHERS:
case OUTPUT:
case OVERRIDING:
case PAD:
case PARAMETER_MODE:
case PARAMETER_NAME:
case PARAMETER_ORDINAL_POSITION:
case PARAMETER_SPECIFIC_CATALOG:
case PARAMETER_SPECIFIC_NAME:
case PARAMETER_SPECIFIC_SCHEMA:
case PARTIAL:
case PASCAL:
case PASSING:
case PASSTHROUGH:
case PAST:
case PATH:
case PLACING:
case PLAN:
case PLI:
case PRECEDING:
case PRESERVE:
case PRIOR:
case PRIVILEGES:
case PUBLIC:
case QUARTER:
case READ:
case RELATIVE:
case REPEATABLE:
case REPLACE:
case RESPECT:
case RESTART:
case RESTRICT:
case RETURNED_CARDINALITY:
case RETURNED_LENGTH:
case RETURNED_OCTET_LENGTH:
case RETURNED_SQLSTATE:
case RETURNING:
case ROLE:
case ROUTINE:
case ROUTINE_CATALOG:
case ROUTINE_NAME:
case ROUTINE_SCHEMA:
case ROW_COUNT:
case SCALAR:
case SCALE:
case SCHEMA:
case SCHEMA_NAME:
case SCOPE_CATALOGS:
case SCOPE_NAME:
case SCOPE_SCHEMA:
case SECTION:
case SECURITY:
case SELF:
case SEQUENCE:
case SERIALIZABLE:
case SERVER:
case SERVER_NAME:
case SESSION:
case SETS:
case SIMPLE:
case SIZE:
case SOURCE:
case SPACE:
case SPECIFIC_NAME:
case SQL_BIGINT:
case SQL_BINARY:
case SQL_BIT:
case SQL_BLOB:
case SQL_BOOLEAN:
case SQL_CHAR:
case SQL_CLOB:
case SQL_DATE:
case SQL_DECIMAL:
case SQL_DOUBLE:
case SQL_FLOAT:
case SQL_INTEGER:
case SQL_INTERVAL_DAY:
case SQL_INTERVAL_DAY_TO_HOUR:
case SQL_INTERVAL_DAY_TO_MINUTE:
case SQL_INTERVAL_DAY_TO_SECOND:
case SQL_INTERVAL_HOUR:
case SQL_INTERVAL_HOUR_TO_MINUTE:
case SQL_INTERVAL_HOUR_TO_SECOND:
case SQL_INTERVAL_MINUTE:
case SQL_INTERVAL_MINUTE_TO_SECOND:
case SQL_INTERVAL_MONTH:
case SQL_INTERVAL_SECOND:
case SQL_INTERVAL_YEAR:
case SQL_INTERVAL_YEAR_TO_MONTH:
case SQL_LONGVARBINARY:
case SQL_LONGVARCHAR:
case SQL_LONGVARNCHAR:
case SQL_NCHAR:
case SQL_NCLOB:
case SQL_NUMERIC:
case SQL_NVARCHAR:
case SQL_REAL:
case SQL_SMALLINT:
case SQL_TIME:
case SQL_TIMESTAMP:
case SQL_TINYINT:
case SQL_TSI_DAY:
case SQL_TSI_FRAC_SECOND:
case SQL_TSI_HOUR:
case SQL_TSI_MICROSECOND:
case SQL_TSI_MINUTE:
case SQL_TSI_MONTH:
case SQL_TSI_QUARTER:
case SQL_TSI_SECOND:
case SQL_TSI_WEEK:
case SQL_TSI_YEAR:
case SQL_VARBINARY:
case SQL_VARCHAR:
case STATE:
case STATEMENT:
case STRUCTURE:
case STYLE:
case SUBCLASS_ORIGIN:
case SUBSTITUTE:
case TABLE_NAME:
case TEMPORARY:
case TIES:
case TIMESTAMPADD:
case TIMESTAMPDIFF:
case TOP_LEVEL_COUNT:
case TRANSACTION:
case TRANSACTIONS_ACTIVE:
case TRANSACTIONS_COMMITTED:
case TRANSACTIONS_ROLLED_BACK:
case TRANSFORM:
case TRANSFORMS:
case TRIGGER_CATALOG:
case TRIGGER_NAME:
case TRIGGER_SCHEMA:
case TYPE:
case UNBOUNDED:
case UNCOMMITTED:
case UNCONDITIONAL:
case UNDER:
case UNNAMED:
case USAGE:
case USER_DEFINED_TYPE_CATALOG:
case USER_DEFINED_TYPE_CODE:
case USER_DEFINED_TYPE_NAME:
case USER_DEFINED_TYPE_SCHEMA:
case UTF8:
case UTF16:
case UTF32:
case VERSION:
case VIEW:
case WEEK:
case WORK:
case WRAPPER:
case WRITE:
case XML:
case ZONE:
case IF:
case MATERIALIZED:
case STORED:
case VIRTUAL:
case JAR:
case FILE:
case ARCHIVE:
case BRACKET_QUOTED_IDENTIFIER:
case QUOTED_IDENTIFIER:
case BACK_QUOTED_IDENTIFIER:
case IDENTIFIER:
case UNICODE_QUOTED_IDENTIFIER:
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case AS:
jj_consume_token(AS);
break;
default:
jj_la1[72] = jj_gen;
;
}
alias = SimpleIdentifier();
break;
default:
jj_la1[73] = jj_gen;
;
}
jj_consume_token(SET);
id = SimpleIdentifier();
targetColumnList.add(id);
jj_consume_token(EQ);
exp = Expression(ExprContext.ACCEPT_SUB_QUERY);
// TODO: support DEFAULT also
sourceExpressionList.add(exp);
label_10:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case COMMA:
;
break;
default:
jj_la1[74] = jj_gen;
break label_10;
}
jj_consume_token(COMMA);
id = SimpleIdentifier();
targetColumnList.add(id);
jj_consume_token(EQ);
exp = Expression(ExprContext.ACCEPT_SUB_QUERY);
sourceExpressionList.add(exp);
}
condition = WhereOpt();
{if (true) return new SqlUpdate(s.addAll(targetColumnList)
.addAll(sourceExpressionList).addIf(condition).pos(), table,
targetColumnList, sourceExpressionList, condition, null, alias);}
throw new Error("Missing return statement in function");
}
/**
* Parses a MERGE statement.
*/
final public SqlNode SqlMerge() throws ParseException {
SqlNode table;
SqlNodeList extendList = null;
SqlIdentifier alias = null;
SqlNode sourceTableRef;
SqlNode condition;
SqlUpdate updateCall = null;
SqlInsert insertCall = null;
final Span s;
jj_consume_token(MERGE);
s = span();
jj_consume_token(INTO);
table = CompoundIdentifier();
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case EXTEND:
case LPAREN:
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case EXTEND:
jj_consume_token(EXTEND);
break;
default:
jj_la1[75] = jj_gen;
;
}
extendList = ExtendList();
table = extend(table, extendList);
break;
default:
jj_la1[76] = jj_gen;
;
}
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case A:
case ABSENT:
case ABSOLUTE:
case ACTION:
case ADA:
case ADD:
case ADMIN:
case AFTER:
case ALWAYS:
case APPLY:
case AS:
case ASC:
case ASSERTION:
case ASSIGNMENT:
case ATTRIBUTE:
case ATTRIBUTES:
case BEFORE:
case BERNOULLI:
case BREADTH:
case C:
case CASCADE:
case CATALOG:
case CATALOG_NAME:
case CENTURY:
case CHAIN:
case CHARACTER_SET_CATALOG:
case CHARACTER_SET_NAME:
case CHARACTER_SET_SCHEMA:
case CHARACTERISTICS:
case CHARACTERS:
case CLASS_ORIGIN:
case COBOL:
case COLLATION:
case COLLATION_CATALOG:
case COLLATION_NAME:
case COLLATION_SCHEMA:
case COLUMN_NAME:
case COMMAND_FUNCTION:
case COMMAND_FUNCTION_CODE:
case COMMITTED:
case CONDITIONAL:
case CONDITION_NUMBER:
case CONNECTION:
case CONNECTION_NAME:
case CONSTRAINT_CATALOG:
case CONSTRAINT_NAME:
case CONSTRAINT_SCHEMA:
case CONSTRAINTS:
case CONSTRUCTOR:
case CONTINUE:
case CURSOR_NAME:
case DATA:
case DATABASE:
case DATETIME_INTERVAL_CODE:
case DATETIME_INTERVAL_PRECISION:
case DECADE:
case DEFAULTS:
case DEFERRABLE:
case DEFERRED:
case DEFINED:
case DEFINER:
case DEGREE:
case DEPTH:
case DERIVED:
case DESC:
case DESCRIPTION:
case DESCRIPTOR:
case DIAGNOSTICS:
case DISPATCH:
case DOMAIN:
case DOW:
case DOY:
case DYNAMIC_FUNCTION:
case DYNAMIC_FUNCTION_CODE:
case ENCODING:
case EPOCH:
case ERROR:
case EXCEPTION:
case EXCLUDE:
case EXCLUDING:
case FINAL:
case FIRST:
case FOLLOWING:
case FORMAT:
case FORTRAN:
case FOUND:
case FRAC_SECOND:
case G:
case GENERAL:
case GENERATED:
case GEOMETRY:
case GO:
case GOTO:
case GRANTED:
case HIERARCHY:
case IGNORE:
case IMMEDIATE:
case IMMEDIATELY:
case IMPLEMENTATION:
case INCLUDING:
case INCREMENT:
case INITIALLY:
case INPUT:
case INSTANCE:
case INSTANTIABLE:
case INVOKER:
case ISODOW:
case ISOYEAR:
case ISOLATION:
case JAVA:
case JSON:
case K:
case KEY:
case KEY_MEMBER:
case KEY_TYPE:
case LABEL:
case LAST:
case LENGTH:
case LEVEL:
case LIBRARY:
case LOCATOR:
case M:
case MAP:
case MATCHED:
case MAXVALUE:
case MESSAGE_LENGTH:
case MESSAGE_OCTET_LENGTH:
case MESSAGE_TEXT:
case MICROSECOND:
case MILLISECOND:
case MILLENNIUM:
case MINVALUE:
case MORE_:
case MUMPS:
case NAME:
case NAMES:
case NANOSECOND:
case NESTING:
case NORMALIZED:
case NULLABLE:
case NULLS:
case NUMBER:
case OBJECT:
case OCTETS:
case OPTION:
case OPTIONS:
case ORDERING:
case ORDINALITY:
case OTHERS:
case OUTPUT:
case OVERRIDING:
case PAD:
case PARAMETER_MODE:
case PARAMETER_NAME:
case PARAMETER_ORDINAL_POSITION:
case PARAMETER_SPECIFIC_CATALOG:
case PARAMETER_SPECIFIC_NAME:
case PARAMETER_SPECIFIC_SCHEMA:
case PARTIAL:
case PASCAL:
case PASSING:
case PASSTHROUGH:
case PAST:
case PATH:
case PLACING:
case PLAN:
case PLI:
case PRECEDING:
case PRESERVE:
case PRIOR:
case PRIVILEGES:
case PUBLIC:
case QUARTER:
case READ:
case RELATIVE:
case REPEATABLE:
case REPLACE:
case RESPECT:
case RESTART:
case RESTRICT:
case RETURNED_CARDINALITY:
case RETURNED_LENGTH:
case RETURNED_OCTET_LENGTH:
case RETURNED_SQLSTATE:
case RETURNING:
case ROLE:
case ROUTINE:
case ROUTINE_CATALOG:
case ROUTINE_NAME:
case ROUTINE_SCHEMA:
case ROW_COUNT:
case SCALAR:
case SCALE:
case SCHEMA:
case SCHEMA_NAME:
case SCOPE_CATALOGS:
case SCOPE_NAME:
case SCOPE_SCHEMA:
case SECTION:
case SECURITY:
case SELF:
case SEQUENCE:
case SERIALIZABLE:
case SERVER:
case SERVER_NAME:
case SESSION:
case SETS:
case SIMPLE:
case SIZE:
case SOURCE:
case SPACE:
case SPECIFIC_NAME:
case SQL_BIGINT:
case SQL_BINARY:
case SQL_BIT:
case SQL_BLOB:
case SQL_BOOLEAN:
case SQL_CHAR:
case SQL_CLOB:
case SQL_DATE:
case SQL_DECIMAL:
case SQL_DOUBLE:
case SQL_FLOAT:
case SQL_INTEGER:
case SQL_INTERVAL_DAY:
case SQL_INTERVAL_DAY_TO_HOUR:
case SQL_INTERVAL_DAY_TO_MINUTE:
case SQL_INTERVAL_DAY_TO_SECOND:
case SQL_INTERVAL_HOUR:
case SQL_INTERVAL_HOUR_TO_MINUTE:
case SQL_INTERVAL_HOUR_TO_SECOND:
case SQL_INTERVAL_MINUTE:
case SQL_INTERVAL_MINUTE_TO_SECOND:
case SQL_INTERVAL_MONTH:
case SQL_INTERVAL_SECOND:
case SQL_INTERVAL_YEAR:
case SQL_INTERVAL_YEAR_TO_MONTH:
case SQL_LONGVARBINARY:
case SQL_LONGVARCHAR:
case SQL_LONGVARNCHAR:
case SQL_NCHAR:
case SQL_NCLOB:
case SQL_NUMERIC:
case SQL_NVARCHAR:
case SQL_REAL:
case SQL_SMALLINT:
case SQL_TIME:
case SQL_TIMESTAMP:
case SQL_TINYINT:
case SQL_TSI_DAY:
case SQL_TSI_FRAC_SECOND:
case SQL_TSI_HOUR:
case SQL_TSI_MICROSECOND:
case SQL_TSI_MINUTE:
case SQL_TSI_MONTH:
case SQL_TSI_QUARTER:
case SQL_TSI_SECOND:
case SQL_TSI_WEEK:
case SQL_TSI_YEAR:
case SQL_VARBINARY:
case SQL_VARCHAR:
case STATE:
case STATEMENT:
case STRUCTURE:
case STYLE:
case SUBCLASS_ORIGIN:
case SUBSTITUTE:
case TABLE_NAME:
case TEMPORARY:
case TIES:
case TIMESTAMPADD:
case TIMESTAMPDIFF:
case TOP_LEVEL_COUNT:
case TRANSACTION:
case TRANSACTIONS_ACTIVE:
case TRANSACTIONS_COMMITTED:
case TRANSACTIONS_ROLLED_BACK:
case TRANSFORM:
case TRANSFORMS:
case TRIGGER_CATALOG:
case TRIGGER_NAME:
case TRIGGER_SCHEMA:
case TYPE:
case UNBOUNDED:
case UNCOMMITTED:
case UNCONDITIONAL:
case UNDER:
case UNNAMED:
case USAGE:
case USER_DEFINED_TYPE_CATALOG:
case USER_DEFINED_TYPE_CODE:
case USER_DEFINED_TYPE_NAME:
case USER_DEFINED_TYPE_SCHEMA:
case UTF8:
case UTF16:
case UTF32:
case VERSION:
case VIEW:
case WEEK:
case WORK:
case WRAPPER:
case WRITE:
case XML:
case ZONE:
case IF:
case MATERIALIZED:
case STORED:
case VIRTUAL:
case JAR:
case FILE:
case ARCHIVE:
case BRACKET_QUOTED_IDENTIFIER:
case QUOTED_IDENTIFIER:
case BACK_QUOTED_IDENTIFIER:
case IDENTIFIER:
case UNICODE_QUOTED_IDENTIFIER:
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case AS:
jj_consume_token(AS);
break;
default:
jj_la1[77] = jj_gen;
;
}
alias = SimpleIdentifier();
break;
default:
jj_la1[78] = jj_gen;
;
}
jj_consume_token(USING);
sourceTableRef = TableRef();
jj_consume_token(ON);
condition = Expression(ExprContext.ACCEPT_SUB_QUERY);
if (jj_2_11(2)) {
updateCall = WhenMatchedClause(table, alias);
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case WHEN:
insertCall = WhenNotMatchedClause(table);
break;
default:
jj_la1[79] = jj_gen;
;
}
} else {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case WHEN:
insertCall = WhenNotMatchedClause(table);
break;
default:
jj_la1[80] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
}
{if (true) return new SqlMerge(s.addIf(updateCall).addIf(insertCall).pos(), table,
condition, sourceTableRef, updateCall, insertCall, null, alias);}
throw new Error("Missing return statement in function");
}
final public SqlUpdate WhenMatchedClause(SqlNode table, SqlIdentifier alias) throws ParseException {
SqlIdentifier id;
final Span s;
final SqlNodeList updateColumnList = new SqlNodeList(SqlParserPos.ZERO);
SqlNode exp;
final SqlNodeList updateExprList = new SqlNodeList(SqlParserPos.ZERO);
jj_consume_token(WHEN);
s = span();
jj_consume_token(MATCHED);
jj_consume_token(THEN);
jj_consume_token(UPDATE);
jj_consume_token(SET);
id = CompoundIdentifier();
updateColumnList.add(id);
jj_consume_token(EQ);
exp = Expression(ExprContext.ACCEPT_SUB_QUERY);
updateExprList.add(exp);
label_11:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case COMMA:
;
break;
default:
jj_la1[81] = jj_gen;
break label_11;
}
jj_consume_token(COMMA);
id = CompoundIdentifier();
updateColumnList.add(id);
jj_consume_token(EQ);
exp = Expression(ExprContext.ACCEPT_SUB_QUERY);
updateExprList.add(exp);
}
{if (true) return new SqlUpdate(s.addAll(updateExprList).pos(), table,
updateColumnList, updateExprList, null, null, alias);}
throw new Error("Missing return statement in function");
}
final public SqlInsert WhenNotMatchedClause(SqlNode table) throws ParseException {
final Span insertSpan, valuesSpan;
final List keywords = new ArrayList();
final SqlNodeList keywordList;
SqlNodeList insertColumnList = null;
SqlNode rowConstructor;
SqlNode insertValues;
jj_consume_token(WHEN);
jj_consume_token(NOT);
jj_consume_token(MATCHED);
jj_consume_token(THEN);
jj_consume_token(INSERT);
insertSpan = span();
SqlInsertKeywords(keywords);
keywordList = new SqlNodeList(keywords, insertSpan.end(this));
if (jj_2_12(2)) {
insertColumnList = ParenthesizedSimpleIdentifierList();
} else {
;
}
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case LPAREN:
jj_consume_token(LPAREN);
break;
default:
jj_la1[82] = jj_gen;
;
}
jj_consume_token(VALUES);
valuesSpan = span();
rowConstructor = RowConstructor();
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case RPAREN:
jj_consume_token(RPAREN);
break;
default:
jj_la1[83] = jj_gen;
;
}
// TODO zfong 5/26/06: note that extra parentheses are accepted above
// around the VALUES clause as a hack for unparse, but this is
// actually invalid SQL; should fix unparse
insertValues = SqlStdOperatorTable.VALUES.createCall(
valuesSpan.end(this), rowConstructor);
{if (true) return new SqlInsert(insertSpan.end(this), keywordList,
table, insertValues, insertColumnList);}
throw new Error("Missing return statement in function");
}
/**
* Parses the select list of a SELECT statement.
*/
final public List SelectList() throws ParseException {
final List list = new ArrayList();
SqlNode item;
item = SelectItem();
list.add(item);
label_12:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case COMMA:
;
break;
default:
jj_la1[84] = jj_gen;
break label_12;
}
jj_consume_token(COMMA);
item = SelectItem();
list.add(item);
}
{if (true) return list;}
throw new Error("Missing return statement in function");
}
/**
* Parses one item in a select list.
*/
final public SqlNode SelectItem() throws ParseException {
SqlNode e;
final SqlIdentifier id;
e = SelectExpression();
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case A:
case ABSENT:
case ABSOLUTE:
case ACTION:
case ADA:
case ADD:
case ADMIN:
case AFTER:
case ALWAYS:
case APPLY:
case AS:
case ASC:
case ASSERTION:
case ASSIGNMENT:
case ATTRIBUTE:
case ATTRIBUTES:
case BEFORE:
case BERNOULLI:
case BREADTH:
case C:
case CASCADE:
case CATALOG:
case CATALOG_NAME:
case CENTURY:
case CHAIN:
case CHARACTER_SET_CATALOG:
case CHARACTER_SET_NAME:
case CHARACTER_SET_SCHEMA:
case CHARACTERISTICS:
case CHARACTERS:
case CLASS_ORIGIN:
case COBOL:
case COLLATION:
case COLLATION_CATALOG:
case COLLATION_NAME:
case COLLATION_SCHEMA:
case COLUMN_NAME:
case COMMAND_FUNCTION:
case COMMAND_FUNCTION_CODE:
case COMMITTED:
case CONDITIONAL:
case CONDITION_NUMBER:
case CONNECTION:
case CONNECTION_NAME:
case CONSTRAINT_CATALOG:
case CONSTRAINT_NAME:
case CONSTRAINT_SCHEMA:
case CONSTRAINTS:
case CONSTRUCTOR:
case CONTINUE:
case CURSOR_NAME:
case DATA:
case DATABASE:
case DATETIME_INTERVAL_CODE:
case DATETIME_INTERVAL_PRECISION:
case DECADE:
case DEFAULTS:
case DEFERRABLE:
case DEFERRED:
case DEFINED:
case DEFINER:
case DEGREE:
case DEPTH:
case DERIVED:
case DESC:
case DESCRIPTION:
case DESCRIPTOR:
case DIAGNOSTICS:
case DISPATCH:
case DOMAIN:
case DOW:
case DOY:
case DYNAMIC_FUNCTION:
case DYNAMIC_FUNCTION_CODE:
case ENCODING:
case EPOCH:
case ERROR:
case EXCEPTION:
case EXCLUDE:
case EXCLUDING:
case FINAL:
case FIRST:
case FOLLOWING:
case FORMAT:
case FORTRAN:
case FOUND:
case FRAC_SECOND:
case G:
case GENERAL:
case GENERATED:
case GEOMETRY:
case GO:
case GOTO:
case GRANTED:
case HIERARCHY:
case IGNORE:
case IMMEDIATE:
case IMMEDIATELY:
case IMPLEMENTATION:
case INCLUDING:
case INCREMENT:
case INITIALLY:
case INPUT:
case INSTANCE:
case INSTANTIABLE:
case INVOKER:
case ISODOW:
case ISOYEAR:
case ISOLATION:
case JAVA:
case JSON:
case K:
case KEY:
case KEY_MEMBER:
case KEY_TYPE:
case LABEL:
case LAST:
case LENGTH:
case LEVEL:
case LIBRARY:
case LOCATOR:
case M:
case MAP:
case MATCHED:
case MAXVALUE:
case MESSAGE_LENGTH:
case MESSAGE_OCTET_LENGTH:
case MESSAGE_TEXT:
case MICROSECOND:
case MILLISECOND:
case MILLENNIUM:
case MINVALUE:
case MORE_:
case MUMPS:
case NAME:
case NAMES:
case NANOSECOND:
case NESTING:
case NORMALIZED:
case NULLABLE:
case NULLS:
case NUMBER:
case OBJECT:
case OCTETS:
case OPTION:
case OPTIONS:
case ORDERING:
case ORDINALITY:
case OTHERS:
case OUTPUT:
case OVERRIDING:
case PAD:
case PARAMETER_MODE:
case PARAMETER_NAME:
case PARAMETER_ORDINAL_POSITION:
case PARAMETER_SPECIFIC_CATALOG:
case PARAMETER_SPECIFIC_NAME:
case PARAMETER_SPECIFIC_SCHEMA:
case PARTIAL:
case PASCAL:
case PASSING:
case PASSTHROUGH:
case PAST:
case PATH:
case PLACING:
case PLAN:
case PLI:
case PRECEDING:
case PRESERVE:
case PRIOR:
case PRIVILEGES:
case PUBLIC:
case QUARTER:
case READ:
case RELATIVE:
case REPEATABLE:
case REPLACE:
case RESPECT:
case RESTART:
case RESTRICT:
case RETURNED_CARDINALITY:
case RETURNED_LENGTH:
case RETURNED_OCTET_LENGTH:
case RETURNED_SQLSTATE:
case RETURNING:
case ROLE:
case ROUTINE:
case ROUTINE_CATALOG:
case ROUTINE_NAME:
case ROUTINE_SCHEMA:
case ROW_COUNT:
case SCALAR:
case SCALE:
case SCHEMA:
case SCHEMA_NAME:
case SCOPE_CATALOGS:
case SCOPE_NAME:
case SCOPE_SCHEMA:
case SECTION:
case SECURITY:
case SELF:
case SEQUENCE:
case SERIALIZABLE:
case SERVER:
case SERVER_NAME:
case SESSION:
case SETS:
case SIMPLE:
case SIZE:
case SOURCE:
case SPACE:
case SPECIFIC_NAME:
case SQL_BIGINT:
case SQL_BINARY:
case SQL_BIT:
case SQL_BLOB:
case SQL_BOOLEAN:
case SQL_CHAR:
case SQL_CLOB:
case SQL_DATE:
case SQL_DECIMAL:
case SQL_DOUBLE:
case SQL_FLOAT:
case SQL_INTEGER:
case SQL_INTERVAL_DAY:
case SQL_INTERVAL_DAY_TO_HOUR:
case SQL_INTERVAL_DAY_TO_MINUTE:
case SQL_INTERVAL_DAY_TO_SECOND:
case SQL_INTERVAL_HOUR:
case SQL_INTERVAL_HOUR_TO_MINUTE:
case SQL_INTERVAL_HOUR_TO_SECOND:
case SQL_INTERVAL_MINUTE:
case SQL_INTERVAL_MINUTE_TO_SECOND:
case SQL_INTERVAL_MONTH:
case SQL_INTERVAL_SECOND:
case SQL_INTERVAL_YEAR:
case SQL_INTERVAL_YEAR_TO_MONTH:
case SQL_LONGVARBINARY:
case SQL_LONGVARCHAR:
case SQL_LONGVARNCHAR:
case SQL_NCHAR:
case SQL_NCLOB:
case SQL_NUMERIC:
case SQL_NVARCHAR:
case SQL_REAL:
case SQL_SMALLINT:
case SQL_TIME:
case SQL_TIMESTAMP:
case SQL_TINYINT:
case SQL_TSI_DAY:
case SQL_TSI_FRAC_SECOND:
case SQL_TSI_HOUR:
case SQL_TSI_MICROSECOND:
case SQL_TSI_MINUTE:
case SQL_TSI_MONTH:
case SQL_TSI_QUARTER:
case SQL_TSI_SECOND:
case SQL_TSI_WEEK:
case SQL_TSI_YEAR:
case SQL_VARBINARY:
case SQL_VARCHAR:
case STATE:
case STATEMENT:
case STRUCTURE:
case STYLE:
case SUBCLASS_ORIGIN:
case SUBSTITUTE:
case TABLE_NAME:
case TEMPORARY:
case TIES:
case TIMESTAMPADD:
case TIMESTAMPDIFF:
case TOP_LEVEL_COUNT:
case TRANSACTION:
case TRANSACTIONS_ACTIVE:
case TRANSACTIONS_COMMITTED:
case TRANSACTIONS_ROLLED_BACK:
case TRANSFORM:
case TRANSFORMS:
case TRIGGER_CATALOG:
case TRIGGER_NAME:
case TRIGGER_SCHEMA:
case TYPE:
case UNBOUNDED:
case UNCOMMITTED:
case UNCONDITIONAL:
case UNDER:
case UNNAMED:
case USAGE:
case USER_DEFINED_TYPE_CATALOG:
case USER_DEFINED_TYPE_CODE:
case USER_DEFINED_TYPE_NAME:
case USER_DEFINED_TYPE_SCHEMA:
case UTF8:
case UTF16:
case UTF32:
case VERSION:
case VIEW:
case WEEK:
case WORK:
case WRAPPER:
case WRITE:
case XML:
case ZONE:
case IF:
case MATERIALIZED:
case STORED:
case VIRTUAL:
case JAR:
case FILE:
case ARCHIVE:
case BRACKET_QUOTED_IDENTIFIER:
case QUOTED_IDENTIFIER:
case BACK_QUOTED_IDENTIFIER:
case IDENTIFIER:
case UNICODE_QUOTED_IDENTIFIER:
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case AS:
jj_consume_token(AS);
break;
default:
jj_la1[85] = jj_gen;
;
}
id = SimpleIdentifier();
e = SqlStdOperatorTable.AS.createCall(span().end(e), e, id);
break;
default:
jj_la1[86] = jj_gen;
;
}
{if (true) return e;}
throw new Error("Missing return statement in function");
}
/**
* Parses one unaliased expression in a select list.
*/
final public SqlNode SelectExpression() throws ParseException {
SqlNode e;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case STAR:
jj_consume_token(STAR);
{if (true) return SqlIdentifier.star(getPos());}
break;
case A:
case ABS:
case ABSENT:
case ABSOLUTE:
case ACTION:
case ADA:
case ADD:
case ADMIN:
case AFTER:
case ALWAYS:
case APPLY:
case ARRAY:
case ASC:
case ASSERTION:
case ASSIGNMENT:
case ATTRIBUTE:
case ATTRIBUTES:
case AVG:
case BEFORE:
case BERNOULLI:
case BREADTH:
case C:
case CARDINALITY:
case CASCADE:
case CASE:
case CAST:
case CATALOG:
case CATALOG_NAME:
case CEIL:
case CEILING:
case CENTURY:
case CHAIN:
case CHAR_LENGTH:
case CHARACTER_LENGTH:
case CHARACTER_SET_CATALOG:
case CHARACTER_SET_NAME:
case CHARACTER_SET_SCHEMA:
case CHARACTERISTICS:
case CHARACTERS:
case CLASSIFIER:
case CLASS_ORIGIN:
case COALESCE:
case COBOL:
case COLLATION:
case COLLATION_CATALOG:
case COLLATION_NAME:
case COLLATION_SCHEMA:
case COLLECT:
case COLUMN_NAME:
case COMMAND_FUNCTION:
case COMMAND_FUNCTION_CODE:
case COMMITTED:
case CONDITIONAL:
case CONDITION_NUMBER:
case CONNECTION:
case CONNECTION_NAME:
case CONSTRAINT_CATALOG:
case CONSTRAINT_NAME:
case CONSTRAINT_SCHEMA:
case CONSTRAINTS:
case CONSTRUCTOR:
case CONTINUE:
case CONVERT:
case COUNT:
case COVAR_POP:
case COVAR_SAMP:
case CUME_DIST:
case CURRENT:
case CURRENT_CATALOG:
case CURRENT_DATE:
case CURRENT_DEFAULT_TRANSFORM_GROUP:
case CURRENT_PATH:
case CURRENT_ROLE:
case CURRENT_SCHEMA:
case CURRENT_TIME:
case CURRENT_TIMESTAMP:
case CURRENT_USER:
case CURSOR:
case CURSOR_NAME:
case DATA:
case DATABASE:
case DATE:
case DATETIME_INTERVAL_CODE:
case DATETIME_INTERVAL_PRECISION:
case DECADE:
case DEFAULTS:
case DEFERRABLE:
case DEFERRED:
case DEFINED:
case DEFINER:
case DEGREE:
case DENSE_RANK:
case DEPTH:
case DERIVED:
case DESC:
case DESCRIPTION:
case DESCRIPTOR:
case DIAGNOSTICS:
case DISPATCH:
case DOMAIN:
case DOW:
case DOY:
case DYNAMIC_FUNCTION:
case DYNAMIC_FUNCTION_CODE:
case ELEMENT:
case ENCODING:
case EPOCH:
case ERROR:
case EXCEPTION:
case EXCLUDE:
case EXCLUDING:
case EXISTS:
case EXP:
case EXTRACT:
case FALSE:
case FINAL:
case FIRST:
case FIRST_VALUE:
case FLOOR:
case FOLLOWING:
case FORMAT:
case FORTRAN:
case FOUND:
case FRAC_SECOND:
case FUSION:
case G:
case GENERAL:
case GENERATED:
case GEOMETRY:
case GO:
case GOTO:
case GRANTED:
case GROUPING:
case HIERARCHY:
case HOUR:
case IGNORE:
case IMMEDIATE:
case IMMEDIATELY:
case IMPLEMENTATION:
case INCLUDING:
case INCREMENT:
case INITIALLY:
case INPUT:
case INSTANCE:
case INSTANTIABLE:
case INTERVAL:
case INVOKER:
case ISODOW:
case ISOYEAR:
case ISOLATION:
case JAVA:
case JSON:
case JSON_ARRAY:
case JSON_ARRAYAGG:
case JSON_EXISTS:
case JSON_OBJECT:
case JSON_OBJECTAGG:
case JSON_QUERY:
case JSON_VALUE:
case K:
case KEY:
case KEY_MEMBER:
case KEY_TYPE:
case LABEL:
case LAG:
case LAST:
case LAST_VALUE:
case LEAD:
case LEFT:
case LENGTH:
case LEVEL:
case LIBRARY:
case LN:
case LOCALTIME:
case LOCALTIMESTAMP:
case LOCATOR:
case LOWER:
case M:
case MAP:
case MATCHED:
case MATCH_NUMBER:
case MAX:
case MAXVALUE:
case MESSAGE_LENGTH:
case MESSAGE_OCTET_LENGTH:
case MESSAGE_TEXT:
case MICROSECOND:
case MILLISECOND:
case MILLENNIUM:
case MIN:
case MINUTE:
case MINVALUE:
case MOD:
case MONTH:
case MORE_:
case MULTISET:
case MUMPS:
case NAME:
case NAMES:
case NANOSECOND:
case NESTING:
case NEW:
case NEXT:
case NORMALIZED:
case NOT:
case NTH_VALUE:
case NTILE:
case NULL:
case NULLABLE:
case NULLIF:
case NULLS:
case NUMBER:
case OBJECT:
case OCTET_LENGTH:
case OCTETS:
case OPTION:
case OPTIONS:
case ORDERING:
case ORDINALITY:
case OTHERS:
case OUTPUT:
case OVERLAY:
case OVERRIDING:
case PAD:
case PARAMETER_MODE:
case PARAMETER_NAME:
case PARAMETER_ORDINAL_POSITION:
case PARAMETER_SPECIFIC_CATALOG:
case PARAMETER_SPECIFIC_NAME:
case PARAMETER_SPECIFIC_SCHEMA:
case PARTIAL:
case PASCAL:
case PASSING:
case PASSTHROUGH:
case PAST:
case PATH:
case PERCENT_RANK:
case PERIOD:
case PLACING:
case PLAN:
case PLI:
case POSITION:
case POWER:
case PRECEDING:
case PRESERVE:
case PREV:
case PRIOR:
case PRIVILEGES:
case PUBLIC:
case QUARTER:
case RANK:
case READ:
case REGR_COUNT:
case REGR_SXX:
case REGR_SYY:
case RELATIVE:
case REPEATABLE:
case REPLACE:
case RESPECT:
case RESTART:
case RESTRICT:
case RETURNED_CARDINALITY:
case RETURNED_LENGTH:
case RETURNED_OCTET_LENGTH:
case RETURNED_SQLSTATE:
case RETURNING:
case RIGHT:
case ROLE:
case ROUTINE:
case ROUTINE_CATALOG:
case ROUTINE_NAME:
case ROUTINE_SCHEMA:
case ROW:
case ROW_COUNT:
case ROW_NUMBER:
case RUNNING:
case SCALAR:
case SCALE:
case SCHEMA:
case SCHEMA_NAME:
case SCOPE_CATALOGS:
case SCOPE_NAME:
case SCOPE_SCHEMA:
case SECOND:
case SECTION:
case SECURITY:
case SELF:
case SEQUENCE:
case SERIALIZABLE:
case SERVER:
case SERVER_NAME:
case SESSION:
case SESSION_USER:
case SETS:
case SIMPLE:
case SIZE:
case SOURCE:
case SPACE:
case SPECIFIC:
case SPECIFIC_NAME:
case SQL_BIGINT:
case SQL_BINARY:
case SQL_BIT:
case SQL_BLOB:
case SQL_BOOLEAN:
case SQL_CHAR:
case SQL_CLOB:
case SQL_DATE:
case SQL_DECIMAL:
case SQL_DOUBLE:
case SQL_FLOAT:
case SQL_INTEGER:
case SQL_INTERVAL_DAY:
case SQL_INTERVAL_DAY_TO_HOUR:
case SQL_INTERVAL_DAY_TO_MINUTE:
case SQL_INTERVAL_DAY_TO_SECOND:
case SQL_INTERVAL_HOUR:
case SQL_INTERVAL_HOUR_TO_MINUTE:
case SQL_INTERVAL_HOUR_TO_SECOND:
case SQL_INTERVAL_MINUTE:
case SQL_INTERVAL_MINUTE_TO_SECOND:
case SQL_INTERVAL_MONTH:
case SQL_INTERVAL_SECOND:
case SQL_INTERVAL_YEAR:
case SQL_INTERVAL_YEAR_TO_MONTH:
case SQL_LONGVARBINARY:
case SQL_LONGVARCHAR:
case SQL_LONGVARNCHAR:
case SQL_NCHAR:
case SQL_NCLOB:
case SQL_NUMERIC:
case SQL_NVARCHAR:
case SQL_REAL:
case SQL_SMALLINT:
case SQL_TIME:
case SQL_TIMESTAMP:
case SQL_TINYINT:
case SQL_TSI_DAY:
case SQL_TSI_FRAC_SECOND:
case SQL_TSI_HOUR:
case SQL_TSI_MICROSECOND:
case SQL_TSI_MINUTE:
case SQL_TSI_MONTH:
case SQL_TSI_QUARTER:
case SQL_TSI_SECOND:
case SQL_TSI_WEEK:
case SQL_TSI_YEAR:
case SQL_VARBINARY:
case SQL_VARCHAR:
case SQRT:
case STATE:
case STATEMENT:
case STDDEV_POP:
case STDDEV_SAMP:
case STRUCTURE:
case STYLE:
case SUBCLASS_ORIGIN:
case SUBSTITUTE:
case SUBSTRING:
case SUM:
case SYSTEM_USER:
case TABLE_NAME:
case TEMPORARY:
case TIES:
case TIME:
case TIMESTAMP:
case TIMESTAMPADD:
case TIMESTAMPDIFF:
case TOP_LEVEL_COUNT:
case TRANSACTION:
case TRANSACTIONS_ACTIVE:
case TRANSACTIONS_COMMITTED:
case TRANSACTIONS_ROLLED_BACK:
case TRANSFORM:
case TRANSFORMS:
case TRANSLATE:
case TRIGGER_CATALOG:
case TRIGGER_NAME:
case TRIGGER_SCHEMA:
case TRIM:
case TRUE:
case TRUNCATE:
case TYPE:
case UNBOUNDED:
case UNCOMMITTED:
case UNCONDITIONAL:
case UNDER:
case UNKNOWN:
case UNNAMED:
case UPPER:
case USAGE:
case USER:
case USER_DEFINED_TYPE_CATALOG:
case USER_DEFINED_TYPE_CODE:
case USER_DEFINED_TYPE_NAME:
case USER_DEFINED_TYPE_SCHEMA:
case UTF8:
case UTF16:
case UTF32:
case VAR_POP:
case VAR_SAMP:
case VERSION:
case VIEW:
case WEEK:
case WORK:
case WRAPPER:
case WRITE:
case XML:
case YEAR:
case ZONE:
case IF:
case MATERIALIZED:
case STORED:
case VIRTUAL:
case JAR:
case FILE:
case ARCHIVE:
case UNSIGNED_INTEGER_LITERAL:
case APPROX_NUMERIC_LITERAL:
case DECIMAL_NUMERIC_LITERAL:
case BINARY_STRING_LITERAL:
case QUOTED_STRING:
case PREFIXED_STRING_LITERAL:
case UNICODE_STRING_LITERAL:
case LPAREN:
case LBRACE_D:
case LBRACE_T:
case LBRACE_TS:
case LBRACE_FN:
case HOOK:
case PLUS:
case MINUS:
case BRACKET_QUOTED_IDENTIFIER:
case QUOTED_IDENTIFIER:
case BACK_QUOTED_IDENTIFIER:
case IDENTIFIER:
case UNICODE_QUOTED_IDENTIFIER:
e = Expression(ExprContext.ACCEPT_SUB_QUERY);
{if (true) return e;}
break;
default:
jj_la1[87] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
throw new Error("Missing return statement in function");
}
final public SqlLiteral Natural() throws ParseException {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case NATURAL:
jj_consume_token(NATURAL);
{if (true) return SqlLiteral.createBoolean(true, getPos());}
break;
default:
jj_la1[88] = jj_gen;
{if (true) return SqlLiteral.createBoolean(false, getPos());}
}
throw new Error("Missing return statement in function");
}
final public SqlLiteral JoinType() throws ParseException {
JoinType joinType;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case JOIN:
jj_consume_token(JOIN);
joinType = JoinType.INNER;
break;
case INNER:
jj_consume_token(INNER);
jj_consume_token(JOIN);
joinType = JoinType.INNER;
break;
case LEFT:
jj_consume_token(LEFT);
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case OUTER:
jj_consume_token(OUTER);
break;
default:
jj_la1[89] = jj_gen;
;
}
jj_consume_token(JOIN);
joinType = JoinType.LEFT;
break;
case RIGHT:
jj_consume_token(RIGHT);
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case OUTER:
jj_consume_token(OUTER);
break;
default:
jj_la1[90] = jj_gen;
;
}
jj_consume_token(JOIN);
joinType = JoinType.RIGHT;
break;
case FULL:
jj_consume_token(FULL);
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case OUTER:
jj_consume_token(OUTER);
break;
default:
jj_la1[91] = jj_gen;
;
}
jj_consume_token(JOIN);
joinType = JoinType.FULL;
break;
case CROSS:
jj_consume_token(CROSS);
jj_consume_token(JOIN);
joinType = JoinType.CROSS;
break;
default:
jj_la1[92] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
{if (true) return joinType.symbol(getPos());}
throw new Error("Missing return statement in function");
}
/** Matches "LEFT JOIN t ON ...", "RIGHT JOIN t USING ...", "JOIN t". */
final public SqlNode JoinTable(SqlNode e) throws ParseException {
SqlNode e2, condition;
final SqlLiteral natural, joinType, on, using;
SqlNodeList list;
natural = Natural();
joinType = JoinType();
e2 = TableRef();
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case ON:
jj_consume_token(ON);
on = JoinConditionType.ON.symbol(getPos());
condition = Expression(ExprContext.ACCEPT_SUB_QUERY);
{if (true) return new SqlJoin(joinType.getParserPosition(),
e,
natural,
joinType,
e2,
on,
condition);}
break;
case USING:
jj_consume_token(USING);
using = JoinConditionType.USING.symbol(getPos());
list = ParenthesizedSimpleIdentifierList();
{if (true) return new SqlJoin(joinType.getParserPosition(),
e,
natural,
joinType,
e2,
using,
new SqlNodeList(list.getList(), Span.of(using).end(this)));}
break;
default:
jj_la1[93] = jj_gen;
{if (true) return new SqlJoin(joinType.getParserPosition(),
e,
natural,
joinType,
e2,
JoinConditionType.NONE.symbol(joinType.getParserPosition()),
null);}
}
throw new Error("Missing return statement in function");
}
// TODO jvs 15-Nov-2003: SQL standard allows parentheses in the FROM list for
// building up non-linear join trees (e.g. OUTER JOIN two tables, and then INNER
// JOIN the result). Also note that aliases on parenthesized FROM expressions
// "hide" all table names inside the parentheses (without aliases, they're
// visible).
//
// We allow CROSS JOIN to have a join condition, even though that is not valid
// SQL; the validator will catch it.
/**
* Parses the FROM clause for a SELECT.
*
* FROM is mandatory in standard SQL, optional in dialects such as MySQL,
* PostgreSQL. The parser allows SELECT without FROM, but the validator fails
* if conformance is, say, STRICT_2003.
*/
final public SqlNode FromClause() throws ParseException {
SqlNode e, e2, condition;
SqlLiteral natural, joinType, joinConditionType;
SqlNodeList list;
SqlParserPos pos;
e = TableRef();
label_13:
while (true) {
if (jj_2_13(2)) {
;
} else {
break label_13;
}
if (jj_2_14(3)) {
natural = Natural();
joinType = JoinType();
e2 = TableRef();
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case ON:
jj_consume_token(ON);
joinConditionType = JoinConditionType.ON.symbol(getPos());
condition = Expression(ExprContext.ACCEPT_SUB_QUERY);
e = new SqlJoin(joinType.getParserPosition(),
e,
natural,
joinType,
e2,
joinConditionType,
condition);
break;
case USING:
jj_consume_token(USING);
joinConditionType = JoinConditionType.USING.symbol(getPos());
list = ParenthesizedSimpleIdentifierList();
e = new SqlJoin(joinType.getParserPosition(),
e,
natural,
joinType,
e2,
joinConditionType,
new SqlNodeList(list.getList(), Span.of(joinConditionType).end(this)));
break;
default:
jj_la1[94] = jj_gen;
e = new SqlJoin(joinType.getParserPosition(),
e,
natural,
joinType,
e2,
JoinConditionType.NONE.symbol(joinType.getParserPosition()),
null);
}
} else {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case COMMA:
jj_consume_token(COMMA);
joinType = JoinType.COMMA.symbol(getPos());
e2 = TableRef();
e = new SqlJoin(joinType.getParserPosition(),
e,
SqlLiteral.createBoolean(false, joinType.getParserPosition()),
joinType,
e2,
JoinConditionType.NONE.symbol(SqlParserPos.ZERO),
null);
break;
case CROSS:
jj_consume_token(CROSS);
joinType = JoinType.CROSS.symbol(getPos());
jj_consume_token(APPLY);
e2 = TableRef2(true);
if (!this.conformance.isApplyAllowed()) {
{if (true) throw SqlUtil.newContextException(getPos(), RESOURCE.applyNotAllowed());}
}
e = new SqlJoin(joinType.getParserPosition(),
e,
SqlLiteral.createBoolean(false, joinType.getParserPosition()),
joinType,
e2,
JoinConditionType.NONE.symbol(SqlParserPos.ZERO),
null);
break;
case OUTER:
jj_consume_token(OUTER);
joinType = JoinType.LEFT.symbol(getPos());
jj_consume_token(APPLY);
e2 = TableRef2(true);
if (!this.conformance.isApplyAllowed()) {
{if (true) throw SqlUtil.newContextException(getPos(), RESOURCE.applyNotAllowed());}
}
e = new SqlJoin(joinType.getParserPosition(),
e,
SqlLiteral.createBoolean(false, joinType.getParserPosition()),
joinType,
e2,
JoinConditionType.ON.symbol(SqlParserPos.ZERO),
SqlLiteral.createBoolean(true, joinType.getParserPosition()));
break;
default:
jj_la1[95] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
}
}
{if (true) return e;}
throw new Error("Missing return statement in function");
}
/**
* Parses a table reference in a FROM clause, not lateral unless LATERAL
* is explicitly specified.
*/
final public SqlNode TableRef() throws ParseException {
final SqlNode e;
e = TableRef2(false);
{if (true) return e;}
throw new Error("Missing return statement in function");
}
/**
* Parses a table reference in a FROM clause.
*/
final public SqlNode TableRef2(boolean lateral) throws ParseException {
SqlNode tableRef;
final SqlNode over;
final SqlNode snapshot;
final SqlNode match;
SqlNodeList extendList = null;
final SqlIdentifier alias;
final Span s, s2;
SqlNodeList args;
SqlNode sample;
boolean isBernoulli;
SqlNumericLiteral samplePercentage;
boolean isRepeatable = false;
int repeatableSeed = 0;
SqlNodeList columnAliasList = null;
SqlUnnestOperator unnestOp = SqlStdOperatorTable.UNNEST;
if (jj_2_15(2)) {
tableRef = CompoundIdentifier();
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case EXTEND:
case LPAREN:
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case EXTEND:
jj_consume_token(EXTEND);
break;
default:
jj_la1[96] = jj_gen;
;
}
extendList = ExtendList();
tableRef = extend(tableRef, extendList);
break;
default:
jj_la1[97] = jj_gen;
;
}
over = TableOverOpt();
if (over != null) {
tableRef = SqlStdOperatorTable.OVER.createCall(
getPos(), tableRef, over);
}
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case FOR:
snapshot = Snapshot(tableRef);
tableRef = SqlStdOperatorTable.LATERAL.createCall(
getPos(), snapshot);
break;
default:
jj_la1[98] = jj_gen;
;
}
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case MATCH_RECOGNIZE:
tableRef = MatchRecognize(tableRef);
break;
default:
jj_la1[99] = jj_gen;
;
}
} else if (jj_2_16(2)) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case LATERAL:
jj_consume_token(LATERAL);
lateral = true;
break;
default:
jj_la1[100] = jj_gen;
;
}
tableRef = ParenthesizedExpression(ExprContext.ACCEPT_QUERY);
over = TableOverOpt();
if (over != null) {
tableRef = SqlStdOperatorTable.OVER.createCall(
getPos(), tableRef, over);
}
if (lateral) {
tableRef = SqlStdOperatorTable.LATERAL.createCall(
getPos(), tableRef);
}
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case MATCH_RECOGNIZE:
tableRef = MatchRecognize(tableRef);
break;
default:
jj_la1[101] = jj_gen;
;
}
} else {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case UNNEST:
jj_consume_token(UNNEST);
s = span();
args = ParenthesizedQueryOrCommaList(ExprContext.ACCEPT_SUB_QUERY);
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case WITH:
jj_consume_token(WITH);
jj_consume_token(ORDINALITY);
unnestOp = SqlStdOperatorTable.UNNEST_WITH_ORDINALITY;
break;
default:
jj_la1[102] = jj_gen;
;
}
tableRef = unnestOp.createCall(s.end(this), args.toArray());
break;
case LATERAL:
case TABLE:
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case LATERAL:
jj_consume_token(LATERAL);
lateral = true;
break;
default:
jj_la1[103] = jj_gen;
;
}
jj_consume_token(TABLE);
s = span();
jj_consume_token(LPAREN);
tableRef = TableFunctionCall(s.pos());
jj_consume_token(RPAREN);
if (lateral) {
tableRef = SqlStdOperatorTable.LATERAL.createCall(
s.end(this), tableRef);
}
break;
default:
jj_la1[104] = jj_gen;
if (jj_2_17(1)) {
tableRef = ExtendedTableRef();
} else {
jj_consume_token(-1);
throw new ParseException();
}
}
}
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case A:
case ABSENT:
case ABSOLUTE:
case ACTION:
case ADA:
case ADD:
case ADMIN:
case AFTER:
case ALWAYS:
case APPLY:
case AS:
case ASC:
case ASSERTION:
case ASSIGNMENT:
case ATTRIBUTE:
case ATTRIBUTES:
case BEFORE:
case BERNOULLI:
case BREADTH:
case C:
case CASCADE:
case CATALOG:
case CATALOG_NAME:
case CENTURY:
case CHAIN:
case CHARACTER_SET_CATALOG:
case CHARACTER_SET_NAME:
case CHARACTER_SET_SCHEMA:
case CHARACTERISTICS:
case CHARACTERS:
case CLASS_ORIGIN:
case COBOL:
case COLLATION:
case COLLATION_CATALOG:
case COLLATION_NAME:
case COLLATION_SCHEMA:
case COLUMN_NAME:
case COMMAND_FUNCTION:
case COMMAND_FUNCTION_CODE:
case COMMITTED:
case CONDITIONAL:
case CONDITION_NUMBER:
case CONNECTION:
case CONNECTION_NAME:
case CONSTRAINT_CATALOG:
case CONSTRAINT_NAME:
case CONSTRAINT_SCHEMA:
case CONSTRAINTS:
case CONSTRUCTOR:
case CONTINUE:
case CURSOR_NAME:
case DATA:
case DATABASE:
case DATETIME_INTERVAL_CODE:
case DATETIME_INTERVAL_PRECISION:
case DECADE:
case DEFAULTS:
case DEFERRABLE:
case DEFERRED:
case DEFINED:
case DEFINER:
case DEGREE:
case DEPTH:
case DERIVED:
case DESC:
case DESCRIPTION:
case DESCRIPTOR:
case DIAGNOSTICS:
case DISPATCH:
case DOMAIN:
case DOW:
case DOY:
case DYNAMIC_FUNCTION:
case DYNAMIC_FUNCTION_CODE:
case ENCODING:
case EPOCH:
case ERROR:
case EXCEPTION:
case EXCLUDE:
case EXCLUDING:
case FINAL:
case FIRST:
case FOLLOWING:
case FORMAT:
case FORTRAN:
case FOUND:
case FRAC_SECOND:
case G:
case GENERAL:
case GENERATED:
case GEOMETRY:
case GO:
case GOTO:
case GRANTED:
case HIERARCHY:
case IGNORE:
case IMMEDIATE:
case IMMEDIATELY:
case IMPLEMENTATION:
case INCLUDING:
case INCREMENT:
case INITIALLY:
case INPUT:
case INSTANCE:
case INSTANTIABLE:
case INVOKER:
case ISODOW:
case ISOYEAR:
case ISOLATION:
case JAVA:
case JSON:
case K:
case KEY:
case KEY_MEMBER:
case KEY_TYPE:
case LABEL:
case LAST:
case LENGTH:
case LEVEL:
case LIBRARY:
case LOCATOR:
case M:
case MAP:
case MATCHED:
case MAXVALUE:
case MESSAGE_LENGTH:
case MESSAGE_OCTET_LENGTH:
case MESSAGE_TEXT:
case MICROSECOND:
case MILLISECOND:
case MILLENNIUM:
case MINVALUE:
case MORE_:
case MUMPS:
case NAME:
case NAMES:
case NANOSECOND:
case NESTING:
case NORMALIZED:
case NULLABLE:
case NULLS:
case NUMBER:
case OBJECT:
case OCTETS:
case OPTION:
case OPTIONS:
case ORDERING:
case ORDINALITY:
case OTHERS:
case OUTPUT:
case OVERRIDING:
case PAD:
case PARAMETER_MODE:
case PARAMETER_NAME:
case PARAMETER_ORDINAL_POSITION:
case PARAMETER_SPECIFIC_CATALOG:
case PARAMETER_SPECIFIC_NAME:
case PARAMETER_SPECIFIC_SCHEMA:
case PARTIAL:
case PASCAL:
case PASSING:
case PASSTHROUGH:
case PAST:
case PATH:
case PLACING:
case PLAN:
case PLI:
case PRECEDING:
case PRESERVE:
case PRIOR:
case PRIVILEGES:
case PUBLIC:
case QUARTER:
case READ:
case RELATIVE:
case REPEATABLE:
case REPLACE:
case RESPECT:
case RESTART:
case RESTRICT:
case RETURNED_CARDINALITY:
case RETURNED_LENGTH:
case RETURNED_OCTET_LENGTH:
case RETURNED_SQLSTATE:
case RETURNING:
case ROLE:
case ROUTINE:
case ROUTINE_CATALOG:
case ROUTINE_NAME:
case ROUTINE_SCHEMA:
case ROW_COUNT:
case SCALAR:
case SCALE:
case SCHEMA:
case SCHEMA_NAME:
case SCOPE_CATALOGS:
case SCOPE_NAME:
case SCOPE_SCHEMA:
case SECTION:
case SECURITY:
case SELF:
case SEQUENCE:
case SERIALIZABLE:
case SERVER:
case SERVER_NAME:
case SESSION:
case SETS:
case SIMPLE:
case SIZE:
case SOURCE:
case SPACE:
case SPECIFIC_NAME:
case SQL_BIGINT:
case SQL_BINARY:
case SQL_BIT:
case SQL_BLOB:
case SQL_BOOLEAN:
case SQL_CHAR:
case SQL_CLOB:
case SQL_DATE:
case SQL_DECIMAL:
case SQL_DOUBLE:
case SQL_FLOAT:
case SQL_INTEGER:
case SQL_INTERVAL_DAY:
case SQL_INTERVAL_DAY_TO_HOUR:
case SQL_INTERVAL_DAY_TO_MINUTE:
case SQL_INTERVAL_DAY_TO_SECOND:
case SQL_INTERVAL_HOUR:
case SQL_INTERVAL_HOUR_TO_MINUTE:
case SQL_INTERVAL_HOUR_TO_SECOND:
case SQL_INTERVAL_MINUTE:
case SQL_INTERVAL_MINUTE_TO_SECOND:
case SQL_INTERVAL_MONTH:
case SQL_INTERVAL_SECOND:
case SQL_INTERVAL_YEAR:
case SQL_INTERVAL_YEAR_TO_MONTH:
case SQL_LONGVARBINARY:
case SQL_LONGVARCHAR:
case SQL_LONGVARNCHAR:
case SQL_NCHAR:
case SQL_NCLOB:
case SQL_NUMERIC:
case SQL_NVARCHAR:
case SQL_REAL:
case SQL_SMALLINT:
case SQL_TIME:
case SQL_TIMESTAMP:
case SQL_TINYINT:
case SQL_TSI_DAY:
case SQL_TSI_FRAC_SECOND:
case SQL_TSI_HOUR:
case SQL_TSI_MICROSECOND:
case SQL_TSI_MINUTE:
case SQL_TSI_MONTH:
case SQL_TSI_QUARTER:
case SQL_TSI_SECOND:
case SQL_TSI_WEEK:
case SQL_TSI_YEAR:
case SQL_VARBINARY:
case SQL_VARCHAR:
case STATE:
case STATEMENT:
case STRUCTURE:
case STYLE:
case SUBCLASS_ORIGIN:
case SUBSTITUTE:
case TABLE_NAME:
case TEMPORARY:
case TIES:
case TIMESTAMPADD:
case TIMESTAMPDIFF:
case TOP_LEVEL_COUNT:
case TRANSACTION:
case TRANSACTIONS_ACTIVE:
case TRANSACTIONS_COMMITTED:
case TRANSACTIONS_ROLLED_BACK:
case TRANSFORM:
case TRANSFORMS:
case TRIGGER_CATALOG:
case TRIGGER_NAME:
case TRIGGER_SCHEMA:
case TYPE:
case UNBOUNDED:
case UNCOMMITTED:
case UNCONDITIONAL:
case UNDER:
case UNNAMED:
case USAGE:
case USER_DEFINED_TYPE_CATALOG:
case USER_DEFINED_TYPE_CODE:
case USER_DEFINED_TYPE_NAME:
case USER_DEFINED_TYPE_SCHEMA:
case UTF8:
case UTF16:
case UTF32:
case VERSION:
case VIEW:
case WEEK:
case WORK:
case WRAPPER:
case WRITE:
case XML:
case ZONE:
case IF:
case MATERIALIZED:
case STORED:
case VIRTUAL:
case JAR:
case FILE:
case ARCHIVE:
case BRACKET_QUOTED_IDENTIFIER:
case QUOTED_IDENTIFIER:
case BACK_QUOTED_IDENTIFIER:
case IDENTIFIER:
case UNICODE_QUOTED_IDENTIFIER:
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case AS:
jj_consume_token(AS);
break;
default:
jj_la1[105] = jj_gen;
;
}
alias = SimpleIdentifier();
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case LPAREN:
columnAliasList = ParenthesizedSimpleIdentifierList();
break;
default:
jj_la1[106] = jj_gen;
;
}
if (columnAliasList == null) {
tableRef = SqlStdOperatorTable.AS.createCall(
Span.of(tableRef).end(this), tableRef, alias);
} else {
List idList = new ArrayList();
idList.add(tableRef);
idList.add(alias);
idList.addAll(columnAliasList.getList());
tableRef = SqlStdOperatorTable.AS.createCall(
Span.of(tableRef).end(this), idList);
}
break;
default:
jj_la1[107] = jj_gen;
;
}
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case TABLESAMPLE:
jj_consume_token(TABLESAMPLE);
s2 = span();
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case SUBSTITUTE:
jj_consume_token(SUBSTITUTE);
jj_consume_token(LPAREN);
sample = StringLiteral();
jj_consume_token(RPAREN);
String sampleName =
SqlLiteral.unchain(sample).getValueAs(String.class);
SqlSampleSpec sampleSpec = SqlSampleSpec.createNamed(sampleName);
final SqlLiteral sampleLiteral =
SqlLiteral.createSample(sampleSpec, s2.end(this));
tableRef = SqlStdOperatorTable.TABLESAMPLE.createCall(
s2.add(tableRef).end(this), tableRef, sampleLiteral);
break;
case BERNOULLI:
case SYSTEM:
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case BERNOULLI:
jj_consume_token(BERNOULLI);
isBernoulli = true;
break;
case SYSTEM:
jj_consume_token(SYSTEM);
isBernoulli = false;
break;
default:
jj_la1[108] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
jj_consume_token(LPAREN);
samplePercentage = UnsignedNumericLiteral();
jj_consume_token(RPAREN);
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case REPEATABLE:
jj_consume_token(REPEATABLE);
jj_consume_token(LPAREN);
repeatableSeed = IntLiteral();
jj_consume_token(RPAREN);
isRepeatable = true;
break;
default:
jj_la1[109] = jj_gen;
;
}
final BigDecimal ONE_HUNDRED = BigDecimal.valueOf(100L);
BigDecimal rate = samplePercentage.bigDecimalValue();
if (rate.compareTo(BigDecimal.ZERO) < 0
|| rate.compareTo(ONE_HUNDRED) > 0)
{
{if (true) throw SqlUtil.newContextException(getPos(), RESOURCE.invalidSampleSize());}
}
// Treat TABLESAMPLE(0) and TABLESAMPLE(100) as no table
// sampling at all. Not strictly correct: TABLESAMPLE(0)
// should produce no output, but it simplifies implementation
// to know that some amount of sampling will occur.
// In practice values less than ~1E-43% are treated as 0.0 and
// values greater than ~99.999997% are treated as 1.0
float fRate = rate.divide(ONE_HUNDRED).floatValue();
if (fRate > 0.0f && fRate < 1.0f) {
SqlSampleSpec tableSampleSpec =
isRepeatable
? SqlSampleSpec.createTableSample(
isBernoulli, fRate, repeatableSeed)
: SqlSampleSpec.createTableSample(isBernoulli, fRate);
SqlLiteral tableSampleLiteral =
SqlLiteral.createSample(tableSampleSpec, s2.end(this));
tableRef = SqlStdOperatorTable.TABLESAMPLE.createCall(
s2.end(this), tableRef, tableSampleLiteral);
}
break;
default:
jj_la1[110] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
break;
default:
jj_la1[111] = jj_gen;
;
}
{if (true) return tableRef;}
throw new Error("Missing return statement in function");
}
final public SqlNodeList ExtendList() throws ParseException {
final Span s;
List list = new ArrayList();
jj_consume_token(LPAREN);
s = span();
ColumnType(list);
label_14:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case COMMA:
;
break;
default:
jj_la1[112] = jj_gen;
break label_14;
}
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 void ColumnType(List list) throws ParseException {
SqlIdentifier name;
SqlDataTypeSpec type;
boolean nullable = true;
name = CompoundIdentifier();
type = DataType();
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case NOT:
jj_consume_token(NOT);
jj_consume_token(NULL);
nullable = false;
break;
default:
jj_la1[113] = jj_gen;
;
}
list.add(name);
list.add(type.withNullable(nullable));
}
/**
* Parses a compound identifier with optional type.
*/
final public void CompoundIdentifierType(List list, List extendList) throws ParseException {
final SqlIdentifier name;
SqlDataTypeSpec type = null;
boolean nullable = true;
name = CompoundIdentifier();
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case A:
case ABSENT:
case ABSOLUTE:
case ACTION:
case ADA:
case ADD:
case ADMIN:
case AFTER:
case ALWAYS:
case ANY:
case APPLY:
case ASC:
case ASSERTION:
case ASSIGNMENT:
case ATTRIBUTE:
case ATTRIBUTES:
case BEFORE:
case BERNOULLI:
case BIGINT:
case BINARY:
case BOOLEAN:
case BREADTH:
case C:
case CASCADE:
case CATALOG:
case CATALOG_NAME:
case CENTURY:
case CHAIN:
case CHAR:
case CHARACTER:
case CHARACTER_SET_CATALOG:
case CHARACTER_SET_NAME:
case CHARACTER_SET_SCHEMA:
case CHARACTERISTICS:
case CHARACTERS:
case CLASS_ORIGIN:
case COBOL:
case COLLATION:
case COLLATION_CATALOG:
case COLLATION_NAME:
case COLLATION_SCHEMA:
case COLUMN_NAME:
case COMMAND_FUNCTION:
case COMMAND_FUNCTION_CODE:
case COMMITTED:
case CONDITIONAL:
case CONDITION_NUMBER:
case CONNECTION:
case CONNECTION_NAME:
case CONSTRAINT_CATALOG:
case CONSTRAINT_NAME:
case CONSTRAINT_SCHEMA:
case CONSTRAINTS:
case CONSTRUCTOR:
case CONTINUE:
case CURSOR_NAME:
case DATA:
case DATABASE:
case DATE:
case DATETIME_INTERVAL_CODE:
case DATETIME_INTERVAL_PRECISION:
case DEC:
case DECADE:
case DECIMAL:
case DEFAULTS:
case DEFERRABLE:
case DEFERRED:
case DEFINED:
case DEFINER:
case DEGREE:
case DEPTH:
case DERIVED:
case DESC:
case DESCRIPTION:
case DESCRIPTOR:
case DIAGNOSTICS:
case DISPATCH:
case DOMAIN:
case DOUBLE:
case DOW:
case DOY:
case DYNAMIC_FUNCTION:
case DYNAMIC_FUNCTION_CODE:
case ENCODING:
case EPOCH:
case ERROR:
case EXCEPTION:
case EXCLUDE:
case EXCLUDING:
case FINAL:
case FIRST:
case FLOAT:
case FOLLOWING:
case FORMAT:
case FORTRAN:
case FOUND:
case FRAC_SECOND:
case G:
case GENERAL:
case GENERATED:
case GEOMETRY:
case GO:
case GOTO:
case GRANTED:
case HIERARCHY:
case IGNORE:
case IMMEDIATE:
case IMMEDIATELY:
case IMPLEMENTATION:
case INCLUDING:
case INCREMENT:
case INITIALLY:
case INPUT:
case INSTANCE:
case INSTANTIABLE:
case INT:
case INTEGER:
case INVOKER:
case ISODOW:
case ISOYEAR:
case ISOLATION:
case JAVA:
case JSON:
case K:
case KEY:
case KEY_MEMBER:
case KEY_TYPE:
case LABEL:
case LAST:
case LENGTH:
case LEVEL:
case LIBRARY:
case LOCATOR:
case M:
case MAP:
case MATCHED:
case MAXVALUE:
case MESSAGE_LENGTH:
case MESSAGE_OCTET_LENGTH:
case MESSAGE_TEXT:
case MICROSECOND:
case MILLISECOND:
case MILLENNIUM:
case MINVALUE:
case MORE_:
case MUMPS:
case NAME:
case NAMES:
case NANOSECOND:
case NESTING:
case NORMALIZED:
case NULLABLE:
case NULLS:
case NUMBER:
case NUMERIC:
case OBJECT:
case OCTETS:
case OPTION:
case OPTIONS:
case ORDERING:
case ORDINALITY:
case OTHERS:
case OUTPUT:
case OVERRIDING:
case PAD:
case PARAMETER_MODE:
case PARAMETER_NAME:
case PARAMETER_ORDINAL_POSITION:
case PARAMETER_SPECIFIC_CATALOG:
case PARAMETER_SPECIFIC_NAME:
case PARAMETER_SPECIFIC_SCHEMA:
case PARTIAL:
case PASCAL:
case PASSING:
case PASSTHROUGH:
case PAST:
case PATH:
case PLACING:
case PLAN:
case PLI:
case PRECEDING:
case PRESERVE:
case PRIOR:
case PRIVILEGES:
case PUBLIC:
case QUARTER:
case READ:
case REAL:
case RELATIVE:
case REPEATABLE:
case REPLACE:
case RESPECT:
case RESTART:
case RESTRICT:
case RETURNED_CARDINALITY:
case RETURNED_LENGTH:
case RETURNED_OCTET_LENGTH:
case RETURNED_SQLSTATE:
case RETURNING:
case ROLE:
case ROUTINE:
case ROUTINE_CATALOG:
case ROUTINE_NAME:
case ROUTINE_SCHEMA:
case ROW:
case ROW_COUNT:
case SCALAR:
case SCALE:
case SCHEMA:
case SCHEMA_NAME:
case SCOPE_CATALOGS:
case SCOPE_NAME:
case SCOPE_SCHEMA:
case SECTION:
case SECURITY:
case SELF:
case SEQUENCE:
case SERIALIZABLE:
case SERVER:
case SERVER_NAME:
case SESSION:
case SETS:
case SIMPLE:
case SIZE:
case SMALLINT:
case SOURCE:
case SPACE:
case SPECIFIC_NAME:
case SQL_BIGINT:
case SQL_BINARY:
case SQL_BIT:
case SQL_BLOB:
case SQL_BOOLEAN:
case SQL_CHAR:
case SQL_CLOB:
case SQL_DATE:
case SQL_DECIMAL:
case SQL_DOUBLE:
case SQL_FLOAT:
case SQL_INTEGER:
case SQL_INTERVAL_DAY:
case SQL_INTERVAL_DAY_TO_HOUR:
case SQL_INTERVAL_DAY_TO_MINUTE:
case SQL_INTERVAL_DAY_TO_SECOND:
case SQL_INTERVAL_HOUR:
case SQL_INTERVAL_HOUR_TO_MINUTE:
case SQL_INTERVAL_HOUR_TO_SECOND:
case SQL_INTERVAL_MINUTE:
case SQL_INTERVAL_MINUTE_TO_SECOND:
case SQL_INTERVAL_MONTH:
case SQL_INTERVAL_SECOND:
case SQL_INTERVAL_YEAR:
case SQL_INTERVAL_YEAR_TO_MONTH:
case SQL_LONGVARBINARY:
case SQL_LONGVARCHAR:
case SQL_LONGVARNCHAR:
case SQL_NCHAR:
case SQL_NCLOB:
case SQL_NUMERIC:
case SQL_NVARCHAR:
case SQL_REAL:
case SQL_SMALLINT:
case SQL_TIME:
case SQL_TIMESTAMP:
case SQL_TINYINT:
case SQL_TSI_DAY:
case SQL_TSI_FRAC_SECOND:
case SQL_TSI_HOUR:
case SQL_TSI_MICROSECOND:
case SQL_TSI_MINUTE:
case SQL_TSI_MONTH:
case SQL_TSI_QUARTER:
case SQL_TSI_SECOND:
case SQL_TSI_WEEK:
case SQL_TSI_YEAR:
case SQL_VARBINARY:
case SQL_VARCHAR:
case STATE:
case STATEMENT:
case STRUCTURE:
case STYLE:
case SUBCLASS_ORIGIN:
case SUBSTITUTE:
case TABLE_NAME:
case TEMPORARY:
case TIES:
case TIME:
case TIMESTAMP:
case TIMESTAMPADD:
case TIMESTAMPDIFF:
case TINYINT:
case TOP_LEVEL_COUNT:
case TRANSACTION:
case TRANSACTIONS_ACTIVE:
case TRANSACTIONS_COMMITTED:
case TRANSACTIONS_ROLLED_BACK:
case TRANSFORM:
case TRANSFORMS:
case TRIGGER_CATALOG:
case TRIGGER_NAME:
case TRIGGER_SCHEMA:
case TYPE:
case UNBOUNDED:
case UNCOMMITTED:
case UNCONDITIONAL:
case UNDER:
case UNNAMED:
case USAGE:
case USER_DEFINED_TYPE_CATALOG:
case USER_DEFINED_TYPE_CODE:
case USER_DEFINED_TYPE_NAME:
case USER_DEFINED_TYPE_SCHEMA:
case UTF8:
case UTF16:
case UTF32:
case VARBINARY:
case VARCHAR:
case VERSION:
case VIEW:
case WEEK:
case WORK:
case WRAPPER:
case WRITE:
case XML:
case ZONE:
case IF:
case MATERIALIZED:
case STORED:
case VIRTUAL:
case JAR:
case FILE:
case ARCHIVE:
case BRACKET_QUOTED_IDENTIFIER:
case QUOTED_IDENTIFIER:
case BACK_QUOTED_IDENTIFIER:
case IDENTIFIER:
case UNICODE_QUOTED_IDENTIFIER:
type = DataType();
if (!this.conformance.allowExtend()) {
{if (true) throw SqlUtil.newContextException(getPos(), RESOURCE.extendNotAllowed());}
}
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case NOT:
jj_consume_token(NOT);
jj_consume_token(NULL);
nullable = false;
break;
default:
jj_la1[114] = jj_gen;
;
}
break;
default:
jj_la1[115] = jj_gen;
;
}
if (type != null) {
extendList.add(name);
extendList.add(type.withNullable(nullable));
}
list.add(name);
}
final public SqlNode TableFunctionCall(SqlParserPos pos) throws ParseException {
SqlNode call;
SqlFunctionCategory funcType = SqlFunctionCategory.USER_DEFINED_TABLE_FUNCTION;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case SPECIFIC:
jj_consume_token(SPECIFIC);
funcType = SqlFunctionCategory.USER_DEFINED_TABLE_SPECIFIC_FUNCTION;
break;
default:
jj_la1[116] = jj_gen;
;
}
call = NamedRoutineCall(funcType, ExprContext.ACCEPT_CURSOR);
{if (true) return SqlStdOperatorTable.COLLECTION_TABLE.createCall(pos, call);}
throw new Error("Missing return statement in function");
}
/**
* Abstract production:
* SqlNode ExtendedTableRef()
*
* Allows parser to be extended with new types of table references. The
* default implementation of this production is empty.
*/
/*
* Abstract production:
*
* SqlNode TableOverOpt()
*
* Allows an OVER clause following a table expression as an extension to
* standard SQL syntax. The default implementation of this production is empty.
*/
/**
* Parses an explicit TABLE t reference.
*/
final public SqlNode ExplicitTable(SqlParserPos pos) throws ParseException {
SqlNode tableRef;
jj_consume_token(TABLE);
tableRef = CompoundIdentifier();
{if (true) return SqlStdOperatorTable.EXPLICIT_TABLE.createCall(pos, tableRef);}
throw new Error("Missing return statement in function");
}
/**
* Parses a VALUES leaf query expression.
*/
final public SqlNode TableConstructor() throws ParseException {
SqlNodeList rowConstructorList;
final Span s;
jj_consume_token(VALUES);
s = span();
rowConstructorList = RowConstructorList(s);
{if (true) return SqlStdOperatorTable.VALUES.createCall(
s.end(this), rowConstructorList.toArray());}
throw new Error("Missing return statement in function");
}
/**
* Parses one or more rows in a VALUES expression.
*/
final public SqlNodeList RowConstructorList(Span s) throws ParseException {
List list = new ArrayList();
SqlNode rowConstructor;
rowConstructor = RowConstructor();
list.add(rowConstructor);
label_15:
while (true) {
if (jj_2_18(2)) {
;
} else {
break label_15;
}
jj_consume_token(COMMA);
rowConstructor = RowConstructor();
list.add(rowConstructor);
}
{if (true) return new SqlNodeList(list, s.end(this));}
throw new Error("Missing return statement in function");
}
/**
* Parses a row constructor in the context of a VALUES expression.
*/
final public SqlNode RowConstructor() throws ParseException {
SqlNodeList valueList;
SqlNode value;
final Span s;
if (jj_2_19(3)) {
jj_consume_token(LPAREN);
s = span();
jj_consume_token(ROW);
valueList = ParenthesizedQueryOrCommaListWithDefault(ExprContext.ACCEPT_NONCURSOR);
jj_consume_token(RPAREN);
s.add(this);
} else if (jj_2_20(3)) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case ROW:
jj_consume_token(ROW);
s = span();
break;
default:
jj_la1[117] = jj_gen;
s = Span.of();
}
valueList = ParenthesizedQueryOrCommaListWithDefault(ExprContext.ACCEPT_NONCURSOR);
} else {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case A:
case ABS:
case ABSENT:
case ABSOLUTE:
case ACTION:
case ADA:
case ADD:
case ADMIN:
case AFTER:
case ALWAYS:
case APPLY:
case ARRAY:
case ASC:
case ASSERTION:
case ASSIGNMENT:
case ATTRIBUTE:
case ATTRIBUTES:
case AVG:
case BEFORE:
case BERNOULLI:
case BREADTH:
case C:
case CARDINALITY:
case CASCADE:
case CASE:
case CAST:
case CATALOG:
case CATALOG_NAME:
case CEIL:
case CEILING:
case CENTURY:
case CHAIN:
case CHAR_LENGTH:
case CHARACTER_LENGTH:
case CHARACTER_SET_CATALOG:
case CHARACTER_SET_NAME:
case CHARACTER_SET_SCHEMA:
case CHARACTERISTICS:
case CHARACTERS:
case CLASSIFIER:
case CLASS_ORIGIN:
case COALESCE:
case COBOL:
case COLLATION:
case COLLATION_CATALOG:
case COLLATION_NAME:
case COLLATION_SCHEMA:
case COLLECT:
case COLUMN_NAME:
case COMMAND_FUNCTION:
case COMMAND_FUNCTION_CODE:
case COMMITTED:
case CONDITIONAL:
case CONDITION_NUMBER:
case CONNECTION:
case CONNECTION_NAME:
case CONSTRAINT_CATALOG:
case CONSTRAINT_NAME:
case CONSTRAINT_SCHEMA:
case CONSTRAINTS:
case CONSTRUCTOR:
case CONTINUE:
case CONVERT:
case COUNT:
case COVAR_POP:
case COVAR_SAMP:
case CUME_DIST:
case CURRENT:
case CURRENT_CATALOG:
case CURRENT_DATE:
case CURRENT_DEFAULT_TRANSFORM_GROUP:
case CURRENT_PATH:
case CURRENT_ROLE:
case CURRENT_SCHEMA:
case CURRENT_TIME:
case CURRENT_TIMESTAMP:
case CURRENT_USER:
case CURSOR:
case CURSOR_NAME:
case DATA:
case DATABASE:
case DATE:
case DATETIME_INTERVAL_CODE:
case DATETIME_INTERVAL_PRECISION:
case DECADE:
case DEFAULTS:
case DEFERRABLE:
case DEFERRED:
case DEFINED:
case DEFINER:
case DEGREE:
case DENSE_RANK:
case DEPTH:
case DERIVED:
case DESC:
case DESCRIPTION:
case DESCRIPTOR:
case DIAGNOSTICS:
case DISPATCH:
case DOMAIN:
case DOW:
case DOY:
case DYNAMIC_FUNCTION:
case DYNAMIC_FUNCTION_CODE:
case ELEMENT:
case ENCODING:
case EPOCH:
case ERROR:
case EXCEPTION:
case EXCLUDE:
case EXCLUDING:
case EXISTS:
case EXP:
case EXTRACT:
case FALSE:
case FINAL:
case FIRST:
case FIRST_VALUE:
case FLOOR:
case FOLLOWING:
case FORMAT:
case FORTRAN:
case FOUND:
case FRAC_SECOND:
case FUSION:
case G:
case GENERAL:
case GENERATED:
case GEOMETRY:
case GO:
case GOTO:
case GRANTED:
case GROUPING:
case HIERARCHY:
case HOUR:
case IGNORE:
case IMMEDIATE:
case IMMEDIATELY:
case IMPLEMENTATION:
case INCLUDING:
case INCREMENT:
case INITIALLY:
case INPUT:
case INSTANCE:
case INSTANTIABLE:
case INTERVAL:
case INVOKER:
case ISODOW:
case ISOYEAR:
case ISOLATION:
case JAVA:
case JSON:
case JSON_ARRAY:
case JSON_ARRAYAGG:
case JSON_EXISTS:
case JSON_OBJECT:
case JSON_OBJECTAGG:
case JSON_QUERY:
case JSON_VALUE:
case K:
case KEY:
case KEY_MEMBER:
case KEY_TYPE:
case LABEL:
case LAG:
case LAST:
case LAST_VALUE:
case LEAD:
case LEFT:
case LENGTH:
case LEVEL:
case LIBRARY:
case LN:
case LOCALTIME:
case LOCALTIMESTAMP:
case LOCATOR:
case LOWER:
case M:
case MAP:
case MATCHED:
case MATCH_NUMBER:
case MAX:
case MAXVALUE:
case MESSAGE_LENGTH:
case MESSAGE_OCTET_LENGTH:
case MESSAGE_TEXT:
case MICROSECOND:
case MILLISECOND:
case MILLENNIUM:
case MIN:
case MINUTE:
case MINVALUE:
case MOD:
case MONTH:
case MORE_:
case MULTISET:
case MUMPS:
case NAME:
case NAMES:
case NANOSECOND:
case NESTING:
case NEW:
case NEXT:
case NORMALIZED:
case NOT:
case NTH_VALUE:
case NTILE:
case NULL:
case NULLABLE:
case NULLIF:
case NULLS:
case NUMBER:
case OBJECT:
case OCTET_LENGTH:
case OCTETS:
case OPTION:
case OPTIONS:
case ORDERING:
case ORDINALITY:
case OTHERS:
case OUTPUT:
case OVERLAY:
case OVERRIDING:
case PAD:
case PARAMETER_MODE:
case PARAMETER_NAME:
case PARAMETER_ORDINAL_POSITION:
case PARAMETER_SPECIFIC_CATALOG:
case PARAMETER_SPECIFIC_NAME:
case PARAMETER_SPECIFIC_SCHEMA:
case PARTIAL:
case PASCAL:
case PASSING:
case PASSTHROUGH:
case PAST:
case PATH:
case PERCENT_RANK:
case PERIOD:
case PLACING:
case PLAN:
case PLI:
case POSITION:
case POWER:
case PRECEDING:
case PRESERVE:
case PREV:
case PRIOR:
case PRIVILEGES:
case PUBLIC:
case QUARTER:
case RANK:
case READ:
case REGR_COUNT:
case REGR_SXX:
case REGR_SYY:
case RELATIVE:
case REPEATABLE:
case REPLACE:
case RESPECT:
case RESTART:
case RESTRICT:
case RETURNED_CARDINALITY:
case RETURNED_LENGTH:
case RETURNED_OCTET_LENGTH:
case RETURNED_SQLSTATE:
case RETURNING:
case RIGHT:
case ROLE:
case ROUTINE:
case ROUTINE_CATALOG:
case ROUTINE_NAME:
case ROUTINE_SCHEMA:
case ROW:
case ROW_COUNT:
case ROW_NUMBER:
case RUNNING:
case SCALAR:
case SCALE:
case SCHEMA:
case SCHEMA_NAME:
case SCOPE_CATALOGS:
case SCOPE_NAME:
case SCOPE_SCHEMA:
case SECOND:
case SECTION:
case SECURITY:
case SELF:
case SEQUENCE:
case SERIALIZABLE:
case SERVER:
case SERVER_NAME:
case SESSION:
case SESSION_USER:
case SETS:
case SIMPLE:
case SIZE:
case SOURCE:
case SPACE:
case SPECIFIC:
case SPECIFIC_NAME:
case SQL_BIGINT:
case SQL_BINARY:
case SQL_BIT:
case SQL_BLOB:
case SQL_BOOLEAN:
case SQL_CHAR:
case SQL_CLOB:
case SQL_DATE:
case SQL_DECIMAL:
case SQL_DOUBLE:
case SQL_FLOAT:
case SQL_INTEGER:
case SQL_INTERVAL_DAY:
case SQL_INTERVAL_DAY_TO_HOUR:
case SQL_INTERVAL_DAY_TO_MINUTE:
case SQL_INTERVAL_DAY_TO_SECOND:
case SQL_INTERVAL_HOUR:
case SQL_INTERVAL_HOUR_TO_MINUTE:
case SQL_INTERVAL_HOUR_TO_SECOND:
case SQL_INTERVAL_MINUTE:
case SQL_INTERVAL_MINUTE_TO_SECOND:
case SQL_INTERVAL_MONTH:
case SQL_INTERVAL_SECOND:
case SQL_INTERVAL_YEAR:
case SQL_INTERVAL_YEAR_TO_MONTH:
case SQL_LONGVARBINARY:
case SQL_LONGVARCHAR:
case SQL_LONGVARNCHAR:
case SQL_NCHAR:
case SQL_NCLOB:
case SQL_NUMERIC:
case SQL_NVARCHAR:
case SQL_REAL:
case SQL_SMALLINT:
case SQL_TIME:
case SQL_TIMESTAMP:
case SQL_TINYINT:
case SQL_TSI_DAY:
case SQL_TSI_FRAC_SECOND:
case SQL_TSI_HOUR:
case SQL_TSI_MICROSECOND:
case SQL_TSI_MINUTE:
case SQL_TSI_MONTH:
case SQL_TSI_QUARTER:
case SQL_TSI_SECOND:
case SQL_TSI_WEEK:
case SQL_TSI_YEAR:
case SQL_VARBINARY:
case SQL_VARCHAR:
case SQRT:
case STATE:
case STATEMENT:
case STDDEV_POP:
case STDDEV_SAMP:
case STRUCTURE:
case STYLE:
case SUBCLASS_ORIGIN:
case SUBSTITUTE:
case SUBSTRING:
case SUM:
case SYSTEM_USER:
case TABLE_NAME:
case TEMPORARY:
case TIES:
case TIME:
case TIMESTAMP:
case TIMESTAMPADD:
case TIMESTAMPDIFF:
case TOP_LEVEL_COUNT:
case TRANSACTION:
case TRANSACTIONS_ACTIVE:
case TRANSACTIONS_COMMITTED:
case TRANSACTIONS_ROLLED_BACK:
case TRANSFORM:
case TRANSFORMS:
case TRANSLATE:
case TRIGGER_CATALOG:
case TRIGGER_NAME:
case TRIGGER_SCHEMA:
case TRIM:
case TRUE:
case TRUNCATE:
case TYPE:
case UNBOUNDED:
case UNCOMMITTED:
case UNCONDITIONAL:
case UNDER:
case UNKNOWN:
case UNNAMED:
case UPPER:
case USAGE:
case USER:
case USER_DEFINED_TYPE_CATALOG:
case USER_DEFINED_TYPE_CODE:
case USER_DEFINED_TYPE_NAME:
case USER_DEFINED_TYPE_SCHEMA:
case UTF8:
case UTF16:
case UTF32:
case VAR_POP:
case VAR_SAMP:
case VERSION:
case VIEW:
case WEEK:
case WORK:
case WRAPPER:
case WRITE:
case XML:
case YEAR:
case ZONE:
case IF:
case MATERIALIZED:
case STORED:
case VIRTUAL:
case JAR:
case FILE:
case ARCHIVE:
case UNSIGNED_INTEGER_LITERAL:
case APPROX_NUMERIC_LITERAL:
case DECIMAL_NUMERIC_LITERAL:
case BINARY_STRING_LITERAL:
case QUOTED_STRING:
case PREFIXED_STRING_LITERAL:
case UNICODE_STRING_LITERAL:
case LPAREN:
case LBRACE_D:
case LBRACE_T:
case LBRACE_TS:
case LBRACE_FN:
case HOOK:
case PLUS:
case MINUS:
case BRACKET_QUOTED_IDENTIFIER:
case QUOTED_IDENTIFIER:
case BACK_QUOTED_IDENTIFIER:
case IDENTIFIER:
case UNICODE_QUOTED_IDENTIFIER:
value = Expression(ExprContext.ACCEPT_NONCURSOR);
// NOTE: A bare value here is standard SQL syntax, believe it or
// not. Taken together with multi-row table constructors, it leads
// to very easy mistakes if you forget the parentheses on a
// single-row constructor. This is also the reason for the
// LOOKAHEAD in RowConstructorList(). It would be so much more
// reasonable to require parentheses. Sigh.
s = Span.of(value);
valueList = new SqlNodeList(Collections.singletonList(value),
value.getParserPosition());
break;
default:
jj_la1[118] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
}
// REVIEW jvs 8-Feb-2004: Should we discriminate between scalar
// sub-queries inside of ROW and row sub-queries? The standard does,
// but the distinction seems to be purely syntactic.
{if (true) return SqlStdOperatorTable.ROW.createCall(s.end(valueList),
valueList.toArray());}
throw new Error("Missing return statement in function");
}
/**
* Parses the optional WHERE clause for SELECT, DELETE, and UPDATE.
*/
final public SqlNode WhereOpt() throws ParseException {
SqlNode condition;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case WHERE:
jj_consume_token(WHERE);
condition = Expression(ExprContext.ACCEPT_SUB_QUERY);
{if (true) return condition;}
break;
default:
jj_la1[119] = jj_gen;
{if (true) return null;}
}
throw new Error("Missing return statement in function");
}
/**
* Parses the optional GROUP BY clause for SELECT.
*/
final public SqlNodeList GroupByOpt() throws ParseException {
List list = new ArrayList();
final Span s;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case GROUP:
jj_consume_token(GROUP);
s = span();
jj_consume_token(BY);
list = GroupingElementList();
{if (true) return new SqlNodeList(list, s.addAll(list).pos());}
break;
default:
jj_la1[120] = jj_gen;
{if (true) return null;}
}
throw new Error("Missing return statement in function");
}
final public List GroupingElementList() throws ParseException {
List list = new ArrayList();
SqlNode e;
e = GroupingElement();
list.add(e);
label_16:
while (true) {
if (jj_2_21(2)) {
;
} else {
break label_16;
}
jj_consume_token(COMMA);
e = GroupingElement();
list.add(e);
}
{if (true) return list;}
throw new Error("Missing return statement in function");
}
final public SqlNode GroupingElement() throws ParseException {
List list;
final SqlNodeList nodes;
final SqlNode e;
final Span s;
if (jj_2_22(2)) {
jj_consume_token(GROUPING);
s = span();
jj_consume_token(SETS);
jj_consume_token(LPAREN);
list = GroupingElementList();
jj_consume_token(RPAREN);
{if (true) return SqlStdOperatorTable.GROUPING_SETS.createCall(s.end(this), list);}
} else {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case ROLLUP:
jj_consume_token(ROLLUP);
s = span();
jj_consume_token(LPAREN);
nodes = ExpressionCommaList(s, ExprContext.ACCEPT_SUB_QUERY);
jj_consume_token(RPAREN);
{if (true) return SqlStdOperatorTable.ROLLUP.createCall(s.end(this),
nodes.getList());}
break;
case CUBE:
jj_consume_token(CUBE);
s = span();
jj_consume_token(LPAREN);
nodes = ExpressionCommaList(s, ExprContext.ACCEPT_SUB_QUERY);
jj_consume_token(RPAREN);
{if (true) return SqlStdOperatorTable.CUBE.createCall(s.end(this),
nodes.getList());}
break;
default:
jj_la1[121] = jj_gen;
if (jj_2_23(3)) {
jj_consume_token(LPAREN);
jj_consume_token(RPAREN);
{if (true) return new SqlNodeList(getPos());}
} else {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case A:
case ABS:
case ABSENT:
case ABSOLUTE:
case ACTION:
case ADA:
case ADD:
case ADMIN:
case AFTER:
case ALWAYS:
case APPLY:
case ARRAY:
case ASC:
case ASSERTION:
case ASSIGNMENT:
case ATTRIBUTE:
case ATTRIBUTES:
case AVG:
case BEFORE:
case BERNOULLI:
case BREADTH:
case C:
case CARDINALITY:
case CASCADE:
case CASE:
case CAST:
case CATALOG:
case CATALOG_NAME:
case CEIL:
case CEILING:
case CENTURY:
case CHAIN:
case CHAR_LENGTH:
case CHARACTER_LENGTH:
case CHARACTER_SET_CATALOG:
case CHARACTER_SET_NAME:
case CHARACTER_SET_SCHEMA:
case CHARACTERISTICS:
case CHARACTERS:
case CLASSIFIER:
case CLASS_ORIGIN:
case COALESCE:
case COBOL:
case COLLATION:
case COLLATION_CATALOG:
case COLLATION_NAME:
case COLLATION_SCHEMA:
case COLLECT:
case COLUMN_NAME:
case COMMAND_FUNCTION:
case COMMAND_FUNCTION_CODE:
case COMMITTED:
case CONDITIONAL:
case CONDITION_NUMBER:
case CONNECTION:
case CONNECTION_NAME:
case CONSTRAINT_CATALOG:
case CONSTRAINT_NAME:
case CONSTRAINT_SCHEMA:
case CONSTRAINTS:
case CONSTRUCTOR:
case CONTINUE:
case CONVERT:
case COUNT:
case COVAR_POP:
case COVAR_SAMP:
case CUME_DIST:
case CURRENT:
case CURRENT_CATALOG:
case CURRENT_DATE:
case CURRENT_DEFAULT_TRANSFORM_GROUP:
case CURRENT_PATH:
case CURRENT_ROLE:
case CURRENT_SCHEMA:
case CURRENT_TIME:
case CURRENT_TIMESTAMP:
case CURRENT_USER:
case CURSOR:
case CURSOR_NAME:
case DATA:
case DATABASE:
case DATE:
case DATETIME_INTERVAL_CODE:
case DATETIME_INTERVAL_PRECISION:
case DECADE:
case DEFAULTS:
case DEFERRABLE:
case DEFERRED:
case DEFINED:
case DEFINER:
case DEGREE:
case DENSE_RANK:
case DEPTH:
case DERIVED:
case DESC:
case DESCRIPTION:
case DESCRIPTOR:
case DIAGNOSTICS:
case DISPATCH:
case DOMAIN:
case DOW:
case DOY:
case DYNAMIC_FUNCTION:
case DYNAMIC_FUNCTION_CODE:
case ELEMENT:
case ENCODING:
case EPOCH:
case ERROR:
case EXCEPTION:
case EXCLUDE:
case EXCLUDING:
case EXISTS:
case EXP:
case EXTRACT:
case FALSE:
case FINAL:
case FIRST:
case FIRST_VALUE:
case FLOOR:
case FOLLOWING:
case FORMAT:
case FORTRAN:
case FOUND:
case FRAC_SECOND:
case FUSION:
case G:
case GENERAL:
case GENERATED:
case GEOMETRY:
case GO:
case GOTO:
case GRANTED:
case GROUPING:
case HIERARCHY:
case HOUR:
case IGNORE:
case IMMEDIATE:
case IMMEDIATELY:
case IMPLEMENTATION:
case INCLUDING:
case INCREMENT:
case INITIALLY:
case INPUT:
case INSTANCE:
case INSTANTIABLE:
case INTERVAL:
case INVOKER:
case ISODOW:
case ISOYEAR:
case ISOLATION:
case JAVA:
case JSON:
case JSON_ARRAY:
case JSON_ARRAYAGG:
case JSON_EXISTS:
case JSON_OBJECT:
case JSON_OBJECTAGG:
case JSON_QUERY:
case JSON_VALUE:
case K:
case KEY:
case KEY_MEMBER:
case KEY_TYPE:
case LABEL:
case LAG:
case LAST:
case LAST_VALUE:
case LEAD:
case LEFT:
case LENGTH:
case LEVEL:
case LIBRARY:
case LN:
case LOCALTIME:
case LOCALTIMESTAMP:
case LOCATOR:
case LOWER:
case M:
case MAP:
case MATCHED:
case MATCH_NUMBER:
case MAX:
case MAXVALUE:
case MESSAGE_LENGTH:
case MESSAGE_OCTET_LENGTH:
case MESSAGE_TEXT:
case MICROSECOND:
case MILLISECOND:
case MILLENNIUM:
case MIN:
case MINUTE:
case MINVALUE:
case MOD:
case MONTH:
case MORE_:
case MULTISET:
case MUMPS:
case NAME:
case NAMES:
case NANOSECOND:
case NESTING:
case NEW:
case NEXT:
case NORMALIZED:
case NOT:
case NTH_VALUE:
case NTILE:
case NULL:
case NULLABLE:
case NULLIF:
case NULLS:
case NUMBER:
case OBJECT:
case OCTET_LENGTH:
case OCTETS:
case OPTION:
case OPTIONS:
case ORDERING:
case ORDINALITY:
case OTHERS:
case OUTPUT:
case OVERLAY:
case OVERRIDING:
case PAD:
case PARAMETER_MODE:
case PARAMETER_NAME:
case PARAMETER_ORDINAL_POSITION:
case PARAMETER_SPECIFIC_CATALOG:
case PARAMETER_SPECIFIC_NAME:
case PARAMETER_SPECIFIC_SCHEMA:
case PARTIAL:
case PASCAL:
case PASSING:
case PASSTHROUGH:
case PAST:
case PATH:
case PERCENT_RANK:
case PERIOD:
case PLACING:
case PLAN:
case PLI:
case POSITION:
case POWER:
case PRECEDING:
case PRESERVE:
case PREV:
case PRIOR:
case PRIVILEGES:
case PUBLIC:
case QUARTER:
case RANK:
case READ:
case REGR_COUNT:
case REGR_SXX:
case REGR_SYY:
case RELATIVE:
case REPEATABLE:
case REPLACE:
case RESPECT:
case RESTART:
case RESTRICT:
case RETURNED_CARDINALITY:
case RETURNED_LENGTH:
case RETURNED_OCTET_LENGTH:
case RETURNED_SQLSTATE:
case RETURNING:
case RIGHT:
case ROLE:
case ROUTINE:
case ROUTINE_CATALOG:
case ROUTINE_NAME:
case ROUTINE_SCHEMA:
case ROW:
case ROW_COUNT:
case ROW_NUMBER:
case RUNNING:
case SCALAR:
case SCALE:
case SCHEMA:
case SCHEMA_NAME:
case SCOPE_CATALOGS:
case SCOPE_NAME:
case SCOPE_SCHEMA:
case SECOND:
case SECTION:
case SECURITY:
case SELF:
case SEQUENCE:
case SERIALIZABLE:
case SERVER:
case SERVER_NAME:
case SESSION:
case SESSION_USER:
case SETS:
case SIMPLE:
case SIZE:
case SOURCE:
case SPACE:
case SPECIFIC:
case SPECIFIC_NAME:
case SQL_BIGINT:
case SQL_BINARY:
case SQL_BIT:
case SQL_BLOB:
case SQL_BOOLEAN:
case SQL_CHAR:
case SQL_CLOB:
case SQL_DATE:
case SQL_DECIMAL:
case SQL_DOUBLE:
case SQL_FLOAT:
case SQL_INTEGER:
case SQL_INTERVAL_DAY:
case SQL_INTERVAL_DAY_TO_HOUR:
case SQL_INTERVAL_DAY_TO_MINUTE:
case SQL_INTERVAL_DAY_TO_SECOND:
case SQL_INTERVAL_HOUR:
case SQL_INTERVAL_HOUR_TO_MINUTE:
case SQL_INTERVAL_HOUR_TO_SECOND:
case SQL_INTERVAL_MINUTE:
case SQL_INTERVAL_MINUTE_TO_SECOND:
case SQL_INTERVAL_MONTH:
case SQL_INTERVAL_SECOND:
case SQL_INTERVAL_YEAR:
case SQL_INTERVAL_YEAR_TO_MONTH:
case SQL_LONGVARBINARY:
case SQL_LONGVARCHAR:
case SQL_LONGVARNCHAR:
case SQL_NCHAR:
case SQL_NCLOB:
case SQL_NUMERIC:
case SQL_NVARCHAR:
case SQL_REAL:
case SQL_SMALLINT:
case SQL_TIME:
case SQL_TIMESTAMP:
case SQL_TINYINT:
case SQL_TSI_DAY:
case SQL_TSI_FRAC_SECOND:
case SQL_TSI_HOUR:
case SQL_TSI_MICROSECOND:
case SQL_TSI_MINUTE:
case SQL_TSI_MONTH:
case SQL_TSI_QUARTER:
case SQL_TSI_SECOND:
case SQL_TSI_WEEK:
case SQL_TSI_YEAR:
case SQL_VARBINARY:
case SQL_VARCHAR:
case SQRT:
case STATE:
case STATEMENT:
case STDDEV_POP:
case STDDEV_SAMP:
case STRUCTURE:
case STYLE:
case SUBCLASS_ORIGIN:
case SUBSTITUTE:
case SUBSTRING:
case SUM:
case SYSTEM_USER:
case TABLE_NAME:
case TEMPORARY:
case TIES:
case TIME:
case TIMESTAMP:
case TIMESTAMPADD:
case TIMESTAMPDIFF:
case TOP_LEVEL_COUNT:
case TRANSACTION:
case TRANSACTIONS_ACTIVE:
case TRANSACTIONS_COMMITTED:
case TRANSACTIONS_ROLLED_BACK:
case TRANSFORM:
case TRANSFORMS:
case TRANSLATE:
case TRIGGER_CATALOG:
case TRIGGER_NAME:
case TRIGGER_SCHEMA:
case TRIM:
case TRUE:
case TRUNCATE:
case TYPE:
case UNBOUNDED:
case UNCOMMITTED:
case UNCONDITIONAL:
case UNDER:
case UNKNOWN:
case UNNAMED:
case UPPER:
case USAGE:
case USER:
case USER_DEFINED_TYPE_CATALOG:
case USER_DEFINED_TYPE_CODE:
case USER_DEFINED_TYPE_NAME:
case USER_DEFINED_TYPE_SCHEMA:
case UTF8:
case UTF16:
case UTF32:
case VAR_POP:
case VAR_SAMP:
case VERSION:
case VIEW:
case WEEK:
case WORK:
case WRAPPER:
case WRITE:
case XML:
case YEAR:
case ZONE:
case IF:
case MATERIALIZED:
case STORED:
case VIRTUAL:
case JAR:
case FILE:
case ARCHIVE:
case UNSIGNED_INTEGER_LITERAL:
case APPROX_NUMERIC_LITERAL:
case DECIMAL_NUMERIC_LITERAL:
case BINARY_STRING_LITERAL:
case QUOTED_STRING:
case PREFIXED_STRING_LITERAL:
case UNICODE_STRING_LITERAL:
case LPAREN:
case LBRACE_D:
case LBRACE_T:
case LBRACE_TS:
case LBRACE_FN:
case HOOK:
case PLUS:
case MINUS:
case BRACKET_QUOTED_IDENTIFIER:
case QUOTED_IDENTIFIER:
case BACK_QUOTED_IDENTIFIER:
case IDENTIFIER:
case UNICODE_QUOTED_IDENTIFIER:
e = Expression(ExprContext.ACCEPT_SUB_QUERY);
{if (true) return e;}
break;
default:
jj_la1[122] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
}
}
}
throw new Error("Missing return statement in function");
}
/**
* Parses a list of expressions separated by commas.
*/
final public SqlNodeList ExpressionCommaList(final Span s,
ExprContext exprContext) throws ParseException {
List list;
SqlNode e;
e = Expression(exprContext);
list = startList(e);
label_17:
while (true) {
if (jj_2_24(2)) {
;
} else {
break label_17;
}
jj_consume_token(COMMA);
e = Expression(ExprContext.ACCEPT_SUB_QUERY);
list.add(e);
}
{if (true) return new SqlNodeList(list, s.addAll(list).pos());}
throw new Error("Missing return statement in function");
}
/**
* Parses the optional HAVING clause for SELECT.
*/
final public SqlNode HavingOpt() throws ParseException {
SqlNode e;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case HAVING:
jj_consume_token(HAVING);
e = Expression(ExprContext.ACCEPT_SUB_QUERY);
{if (true) return e;}
break;
default:
jj_la1[123] = jj_gen;
{if (true) return null;}
}
throw new Error("Missing return statement in function");
}
/**
* Parses the optional WINDOW clause for SELECT
*/
final public SqlNodeList WindowOpt() throws ParseException {
SqlIdentifier id;
SqlWindow e;
List list;
final Span s;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case WINDOW:
jj_consume_token(WINDOW);
s = span();
id = SimpleIdentifier();
jj_consume_token(AS);
e = WindowSpecification();
e.setDeclName(id);
list = startList(e);
label_18:
while (true) {
if (jj_2_25(2)) {
;
} else {
break label_18;
}
jj_consume_token(COMMA);
id = SimpleIdentifier();
jj_consume_token(AS);
e = WindowSpecification();
e.setDeclName(id);
list.add(e);
}
{if (true) return new SqlNodeList(list, s.addAll(list).pos());}
break;
default:
jj_la1[124] = jj_gen;
{if (true) return null;}
}
throw new Error("Missing return statement in function");
}
/**
* Parses a window specification.
*/
final public SqlWindow WindowSpecification() throws ParseException {
SqlIdentifier id;
List list;
SqlNodeList partitionList;
SqlNodeList orderList;
SqlLiteral isRows = SqlLiteral.createBoolean(false, SqlParserPos.ZERO);
SqlNode lowerBound = null, upperBound = null;
SqlParserPos startPos;
final Span s, s1, s2;
SqlLiteral allowPartial = null;
jj_consume_token(LPAREN);
s = span();
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case A:
case ABSENT:
case ABSOLUTE:
case ACTION:
case ADA:
case ADD:
case ADMIN:
case AFTER:
case ALWAYS:
case APPLY:
case ASC:
case ASSERTION:
case ASSIGNMENT:
case ATTRIBUTE:
case ATTRIBUTES:
case BEFORE:
case BERNOULLI:
case BREADTH:
case C:
case CASCADE:
case CATALOG:
case CATALOG_NAME:
case CENTURY:
case CHAIN:
case CHARACTER_SET_CATALOG:
case CHARACTER_SET_NAME:
case CHARACTER_SET_SCHEMA:
case CHARACTERISTICS:
case CHARACTERS:
case CLASS_ORIGIN:
case COBOL:
case COLLATION:
case COLLATION_CATALOG:
case COLLATION_NAME:
case COLLATION_SCHEMA:
case COLUMN_NAME:
case COMMAND_FUNCTION:
case COMMAND_FUNCTION_CODE:
case COMMITTED:
case CONDITIONAL:
case CONDITION_NUMBER:
case CONNECTION:
case CONNECTION_NAME:
case CONSTRAINT_CATALOG:
case CONSTRAINT_NAME:
case CONSTRAINT_SCHEMA:
case CONSTRAINTS:
case CONSTRUCTOR:
case CONTINUE:
case CURSOR_NAME:
case DATA:
case DATABASE:
case DATETIME_INTERVAL_CODE:
case DATETIME_INTERVAL_PRECISION:
case DECADE:
case DEFAULTS:
case DEFERRABLE:
case DEFERRED:
case DEFINED:
case DEFINER:
case DEGREE:
case DEPTH:
case DERIVED:
case DESC:
case DESCRIPTION:
case DESCRIPTOR:
case DIAGNOSTICS:
case DISPATCH:
case DOMAIN:
case DOW:
case DOY:
case DYNAMIC_FUNCTION:
case DYNAMIC_FUNCTION_CODE:
case ENCODING:
case EPOCH:
case ERROR:
case EXCEPTION:
case EXCLUDE:
case EXCLUDING:
case FINAL:
case FIRST:
case FOLLOWING:
case FORMAT:
case FORTRAN:
case FOUND:
case FRAC_SECOND:
case G:
case GENERAL:
case GENERATED:
case GEOMETRY:
case GO:
case GOTO:
case GRANTED:
case HIERARCHY:
case IGNORE:
case IMMEDIATE:
case IMMEDIATELY:
case IMPLEMENTATION:
case INCLUDING:
case INCREMENT:
case INITIALLY:
case INPUT:
case INSTANCE:
case INSTANTIABLE:
case INVOKER:
case ISODOW:
case ISOYEAR:
case ISOLATION:
case JAVA:
case JSON:
case K:
case KEY:
case KEY_MEMBER:
case KEY_TYPE:
case LABEL:
case LAST:
case LENGTH:
case LEVEL:
case LIBRARY:
case LOCATOR:
case M:
case MAP:
case MATCHED:
case MAXVALUE:
case MESSAGE_LENGTH:
case MESSAGE_OCTET_LENGTH:
case MESSAGE_TEXT:
case MICROSECOND:
case MILLISECOND:
case MILLENNIUM:
case MINVALUE:
case MORE_:
case MUMPS:
case NAME:
case NAMES:
case NANOSECOND:
case NESTING:
case NORMALIZED:
case NULLABLE:
case NULLS:
case NUMBER:
case OBJECT:
case OCTETS:
case OPTION:
case OPTIONS:
case ORDERING:
case ORDINALITY:
case OTHERS:
case OUTPUT:
case OVERRIDING:
case PAD:
case PARAMETER_MODE:
case PARAMETER_NAME:
case PARAMETER_ORDINAL_POSITION:
case PARAMETER_SPECIFIC_CATALOG:
case PARAMETER_SPECIFIC_NAME:
case PARAMETER_SPECIFIC_SCHEMA:
case PARTIAL:
case PASCAL:
case PASSING:
case PASSTHROUGH:
case PAST:
case PATH:
case PLACING:
case PLAN:
case PLI:
case PRECEDING:
case PRESERVE:
case PRIOR:
case PRIVILEGES:
case PUBLIC:
case QUARTER:
case READ:
case RELATIVE:
case REPEATABLE:
case REPLACE:
case RESPECT:
case RESTART:
case RESTRICT:
case RETURNED_CARDINALITY:
case RETURNED_LENGTH:
case RETURNED_OCTET_LENGTH:
case RETURNED_SQLSTATE:
case RETURNING:
case ROLE:
case ROUTINE:
case ROUTINE_CATALOG:
case ROUTINE_NAME:
case ROUTINE_SCHEMA:
case ROW_COUNT:
case SCALAR:
case SCALE:
case SCHEMA:
case SCHEMA_NAME:
case SCOPE_CATALOGS:
case SCOPE_NAME:
case SCOPE_SCHEMA:
case SECTION:
case SECURITY:
case SELF:
case SEQUENCE:
case SERIALIZABLE:
case SERVER:
case SERVER_NAME:
case SESSION:
case SETS:
case SIMPLE:
case SIZE:
case SOURCE:
case SPACE:
case SPECIFIC_NAME:
case SQL_BIGINT:
case SQL_BINARY:
case SQL_BIT:
case SQL_BLOB:
case SQL_BOOLEAN:
case SQL_CHAR:
case SQL_CLOB:
case SQL_DATE:
case SQL_DECIMAL:
case SQL_DOUBLE:
case SQL_FLOAT:
case SQL_INTEGER:
case SQL_INTERVAL_DAY:
case SQL_INTERVAL_DAY_TO_HOUR:
case SQL_INTERVAL_DAY_TO_MINUTE:
case SQL_INTERVAL_DAY_TO_SECOND:
case SQL_INTERVAL_HOUR:
case SQL_INTERVAL_HOUR_TO_MINUTE:
case SQL_INTERVAL_HOUR_TO_SECOND:
case SQL_INTERVAL_MINUTE:
case SQL_INTERVAL_MINUTE_TO_SECOND:
case SQL_INTERVAL_MONTH:
case SQL_INTERVAL_SECOND:
case SQL_INTERVAL_YEAR:
case SQL_INTERVAL_YEAR_TO_MONTH:
case SQL_LONGVARBINARY:
case SQL_LONGVARCHAR:
case SQL_LONGVARNCHAR:
case SQL_NCHAR:
case SQL_NCLOB:
case SQL_NUMERIC:
case SQL_NVARCHAR:
case SQL_REAL:
case SQL_SMALLINT:
case SQL_TIME:
case SQL_TIMESTAMP:
case SQL_TINYINT:
case SQL_TSI_DAY:
case SQL_TSI_FRAC_SECOND:
case SQL_TSI_HOUR:
case SQL_TSI_MICROSECOND:
case SQL_TSI_MINUTE:
case SQL_TSI_MONTH:
case SQL_TSI_QUARTER:
case SQL_TSI_SECOND:
case SQL_TSI_WEEK:
case SQL_TSI_YEAR:
case SQL_VARBINARY:
case SQL_VARCHAR:
case STATE:
case STATEMENT:
case STRUCTURE:
case STYLE:
case SUBCLASS_ORIGIN:
case SUBSTITUTE:
case TABLE_NAME:
case TEMPORARY:
case TIES:
case TIMESTAMPADD:
case TIMESTAMPDIFF:
case TOP_LEVEL_COUNT:
case TRANSACTION:
case TRANSACTIONS_ACTIVE:
case TRANSACTIONS_COMMITTED:
case TRANSACTIONS_ROLLED_BACK:
case TRANSFORM:
case TRANSFORMS:
case TRIGGER_CATALOG:
case TRIGGER_NAME:
case TRIGGER_SCHEMA:
case TYPE:
case UNBOUNDED:
case UNCOMMITTED:
case UNCONDITIONAL:
case UNDER:
case UNNAMED:
case USAGE:
case USER_DEFINED_TYPE_CATALOG:
case USER_DEFINED_TYPE_CODE:
case USER_DEFINED_TYPE_NAME:
case USER_DEFINED_TYPE_SCHEMA:
case UTF8:
case UTF16:
case UTF32:
case VERSION:
case VIEW:
case WEEK:
case WORK:
case WRAPPER:
case WRITE:
case XML:
case ZONE:
case IF:
case MATERIALIZED:
case STORED:
case VIRTUAL:
case JAR:
case FILE:
case ARCHIVE:
case BRACKET_QUOTED_IDENTIFIER:
case QUOTED_IDENTIFIER:
case BACK_QUOTED_IDENTIFIER:
case IDENTIFIER:
case UNICODE_QUOTED_IDENTIFIER:
id = SimpleIdentifier();
break;
default:
jj_la1[125] = jj_gen;
id = null;
}
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case PARTITION:
jj_consume_token(PARTITION);
s1 = span();
jj_consume_token(BY);
partitionList = ExpressionCommaList(s1, ExprContext.ACCEPT_NON_QUERY);
break;
default:
jj_la1[126] = jj_gen;
partitionList = SqlNodeList.EMPTY;
}
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case ORDER:
orderList = OrderBy(true);
break;
default:
jj_la1[127] = jj_gen;
orderList = SqlNodeList.EMPTY;
}
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case RANGE:
case ROWS:
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case ROWS:
jj_consume_token(ROWS);
isRows = SqlLiteral.createBoolean(true, getPos());
break;
case RANGE:
jj_consume_token(RANGE);
isRows = SqlLiteral.createBoolean(false, getPos());
break;
default:
jj_la1[128] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case BETWEEN:
jj_consume_token(BETWEEN);
lowerBound = WindowRange();
jj_consume_token(AND);
upperBound = WindowRange();
break;
case A:
case ABS:
case ABSENT:
case ABSOLUTE:
case ACTION:
case ADA:
case ADD:
case ADMIN:
case AFTER:
case ALWAYS:
case APPLY:
case ARRAY:
case ASC:
case ASSERTION:
case ASSIGNMENT:
case ATTRIBUTE:
case ATTRIBUTES:
case AVG:
case BEFORE:
case BERNOULLI:
case BREADTH:
case C:
case CARDINALITY:
case CASCADE:
case CASE:
case CAST:
case CATALOG:
case CATALOG_NAME:
case CEIL:
case CEILING:
case CENTURY:
case CHAIN:
case CHAR_LENGTH:
case CHARACTER_LENGTH:
case CHARACTER_SET_CATALOG:
case CHARACTER_SET_NAME:
case CHARACTER_SET_SCHEMA:
case CHARACTERISTICS:
case CHARACTERS:
case CLASSIFIER:
case CLASS_ORIGIN:
case COALESCE:
case COBOL:
case COLLATION:
case COLLATION_CATALOG:
case COLLATION_NAME:
case COLLATION_SCHEMA:
case COLLECT:
case COLUMN_NAME:
case COMMAND_FUNCTION:
case COMMAND_FUNCTION_CODE:
case COMMITTED:
case CONDITIONAL:
case CONDITION_NUMBER:
case CONNECTION:
case CONNECTION_NAME:
case CONSTRAINT_CATALOG:
case CONSTRAINT_NAME:
case CONSTRAINT_SCHEMA:
case CONSTRAINTS:
case CONSTRUCTOR:
case CONTINUE:
case CONVERT:
case COUNT:
case COVAR_POP:
case COVAR_SAMP:
case CUME_DIST:
case CURRENT:
case CURRENT_CATALOG:
case CURRENT_DATE:
case CURRENT_DEFAULT_TRANSFORM_GROUP:
case CURRENT_PATH:
case CURRENT_ROLE:
case CURRENT_SCHEMA:
case CURRENT_TIME:
case CURRENT_TIMESTAMP:
case CURRENT_USER:
case CURSOR:
case CURSOR_NAME:
case DATA:
case DATABASE:
case DATE:
case DATETIME_INTERVAL_CODE:
case DATETIME_INTERVAL_PRECISION:
case DECADE:
case DEFAULTS:
case DEFERRABLE:
case DEFERRED:
case DEFINED:
case DEFINER:
case DEGREE:
case DENSE_RANK:
case DEPTH:
case DERIVED:
case DESC:
case DESCRIPTION:
case DESCRIPTOR:
case DIAGNOSTICS:
case DISPATCH:
case DOMAIN:
case DOW:
case DOY:
case DYNAMIC_FUNCTION:
case DYNAMIC_FUNCTION_CODE:
case ELEMENT:
case ENCODING:
case EPOCH:
case ERROR:
case EXCEPTION:
case EXCLUDE:
case EXCLUDING:
case EXISTS:
case EXP:
case EXTRACT:
case FALSE:
case FINAL:
case FIRST:
case FIRST_VALUE:
case FLOOR:
case FOLLOWING:
case FORMAT:
case FORTRAN:
case FOUND:
case FRAC_SECOND:
case FUSION:
case G:
case GENERAL:
case GENERATED:
case GEOMETRY:
case GO:
case GOTO:
case GRANTED:
case GROUPING:
case HIERARCHY:
case HOUR:
case IGNORE:
case IMMEDIATE:
case IMMEDIATELY:
case IMPLEMENTATION:
case INCLUDING:
case INCREMENT:
case INITIALLY:
case INPUT:
case INSTANCE:
case INSTANTIABLE:
case INTERVAL:
case INVOKER:
case ISODOW:
case ISOYEAR:
case ISOLATION:
case JAVA:
case JSON:
case JSON_ARRAY:
case JSON_ARRAYAGG:
case JSON_EXISTS:
case JSON_OBJECT:
case JSON_OBJECTAGG:
case JSON_QUERY:
case JSON_VALUE:
case K:
case KEY:
case KEY_MEMBER:
case KEY_TYPE:
case LABEL:
case LAG:
case LAST:
case LAST_VALUE:
case LEAD:
case LEFT:
case LENGTH:
case LEVEL:
case LIBRARY:
case LN:
case LOCALTIME:
case LOCALTIMESTAMP:
case LOCATOR:
case LOWER:
case M:
case MAP:
case MATCHED:
case MATCH_NUMBER:
case MAX:
case MAXVALUE:
case MESSAGE_LENGTH:
case MESSAGE_OCTET_LENGTH:
case MESSAGE_TEXT:
case MICROSECOND:
case MILLISECOND:
case MILLENNIUM:
case MIN:
case MINUTE:
case MINVALUE:
case MOD:
case MONTH:
case MORE_:
case MULTISET:
case MUMPS:
case NAME:
case NAMES:
case NANOSECOND:
case NESTING:
case NEW:
case NEXT:
case NORMALIZED:
case NOT:
case NTH_VALUE:
case NTILE:
case NULL:
case NULLABLE:
case NULLIF:
case NULLS:
case NUMBER:
case OBJECT:
case OCTET_LENGTH:
case OCTETS:
case OPTION:
case OPTIONS:
case ORDERING:
case ORDINALITY:
case OTHERS:
case OUTPUT:
case OVERLAY:
case OVERRIDING:
case PAD:
case PARAMETER_MODE:
case PARAMETER_NAME:
case PARAMETER_ORDINAL_POSITION:
case PARAMETER_SPECIFIC_CATALOG:
case PARAMETER_SPECIFIC_NAME:
case PARAMETER_SPECIFIC_SCHEMA:
case PARTIAL:
case PASCAL:
case PASSING:
case PASSTHROUGH:
case PAST:
case PATH:
case PERCENT_RANK:
case PERIOD:
case PLACING:
case PLAN:
case PLI:
case POSITION:
case POWER:
case PRECEDING:
case PRESERVE:
case PREV:
case PRIOR:
case PRIVILEGES:
case PUBLIC:
case QUARTER:
case RANK:
case READ:
case REGR_COUNT:
case REGR_SXX:
case REGR_SYY:
case RELATIVE:
case REPEATABLE:
case REPLACE:
case RESPECT:
case RESTART:
case RESTRICT:
case RETURNED_CARDINALITY:
case RETURNED_LENGTH:
case RETURNED_OCTET_LENGTH:
case RETURNED_SQLSTATE:
case RETURNING:
case RIGHT:
case ROLE:
case ROUTINE:
case ROUTINE_CATALOG:
case ROUTINE_NAME:
case ROUTINE_SCHEMA:
case ROW:
case ROW_COUNT:
case ROW_NUMBER:
case RUNNING:
case SCALAR:
case SCALE:
case SCHEMA:
case SCHEMA_NAME:
case SCOPE_CATALOGS:
case SCOPE_NAME:
case SCOPE_SCHEMA:
case SECOND:
case SECTION:
case SECURITY:
case SELF:
case SEQUENCE:
case SERIALIZABLE:
case SERVER:
case SERVER_NAME:
case SESSION:
case SESSION_USER:
case SETS:
case SIMPLE:
case SIZE:
case SOURCE:
case SPACE:
case SPECIFIC:
case SPECIFIC_NAME:
case SQL_BIGINT:
case SQL_BINARY:
case SQL_BIT:
case SQL_BLOB:
case SQL_BOOLEAN:
case SQL_CHAR:
case SQL_CLOB:
case SQL_DATE:
case SQL_DECIMAL:
case SQL_DOUBLE:
case SQL_FLOAT:
case SQL_INTEGER:
case SQL_INTERVAL_DAY:
case SQL_INTERVAL_DAY_TO_HOUR:
case SQL_INTERVAL_DAY_TO_MINUTE:
case SQL_INTERVAL_DAY_TO_SECOND:
case SQL_INTERVAL_HOUR:
case SQL_INTERVAL_HOUR_TO_MINUTE:
case SQL_INTERVAL_HOUR_TO_SECOND:
case SQL_INTERVAL_MINUTE:
case SQL_INTERVAL_MINUTE_TO_SECOND:
case SQL_INTERVAL_MONTH:
case SQL_INTERVAL_SECOND:
case SQL_INTERVAL_YEAR:
case SQL_INTERVAL_YEAR_TO_MONTH:
case SQL_LONGVARBINARY:
case SQL_LONGVARCHAR:
case SQL_LONGVARNCHAR:
case SQL_NCHAR:
case SQL_NCLOB:
case SQL_NUMERIC:
case SQL_NVARCHAR:
case SQL_REAL:
case SQL_SMALLINT:
case SQL_TIME:
case SQL_TIMESTAMP:
case SQL_TINYINT:
case SQL_TSI_DAY:
case SQL_TSI_FRAC_SECOND:
case SQL_TSI_HOUR:
case SQL_TSI_MICROSECOND:
case SQL_TSI_MINUTE:
case SQL_TSI_MONTH:
case SQL_TSI_QUARTER:
case SQL_TSI_SECOND:
case SQL_TSI_WEEK:
case SQL_TSI_YEAR:
case SQL_VARBINARY:
case SQL_VARCHAR:
case SQRT:
case STATE:
case STATEMENT:
case STDDEV_POP:
case STDDEV_SAMP:
case STRUCTURE:
case STYLE:
case SUBCLASS_ORIGIN:
case SUBSTITUTE:
case SUBSTRING:
case SUM:
case SYSTEM_USER:
case TABLE_NAME:
case TEMPORARY:
case TIES:
case TIME:
case TIMESTAMP:
case TIMESTAMPADD:
case TIMESTAMPDIFF:
case TOP_LEVEL_COUNT:
case TRANSACTION:
case TRANSACTIONS_ACTIVE:
case TRANSACTIONS_COMMITTED:
case TRANSACTIONS_ROLLED_BACK:
case TRANSFORM:
case TRANSFORMS:
case TRANSLATE:
case TRIGGER_CATALOG:
case TRIGGER_NAME:
case TRIGGER_SCHEMA:
case TRIM:
case TRUE:
case TRUNCATE:
case TYPE:
case UNBOUNDED:
case UNCOMMITTED:
case UNCONDITIONAL:
case UNDER:
case UNKNOWN:
case UNNAMED:
case UPPER:
case USAGE:
case USER:
case USER_DEFINED_TYPE_CATALOG:
case USER_DEFINED_TYPE_CODE:
case USER_DEFINED_TYPE_NAME:
case USER_DEFINED_TYPE_SCHEMA:
case UTF8:
case UTF16:
case UTF32:
case VAR_POP:
case VAR_SAMP:
case VERSION:
case VIEW:
case WEEK:
case WORK:
case WRAPPER:
case WRITE:
case XML:
case YEAR:
case ZONE:
case IF:
case MATERIALIZED:
case STORED:
case VIRTUAL:
case JAR:
case FILE:
case ARCHIVE:
case UNSIGNED_INTEGER_LITERAL:
case APPROX_NUMERIC_LITERAL:
case DECIMAL_NUMERIC_LITERAL:
case BINARY_STRING_LITERAL:
case QUOTED_STRING:
case PREFIXED_STRING_LITERAL:
case UNICODE_STRING_LITERAL:
case LPAREN:
case LBRACE_D:
case LBRACE_T:
case LBRACE_TS:
case LBRACE_FN:
case HOOK:
case PLUS:
case MINUS:
case BRACKET_QUOTED_IDENTIFIER:
case QUOTED_IDENTIFIER:
case BACK_QUOTED_IDENTIFIER:
case IDENTIFIER:
case UNICODE_QUOTED_IDENTIFIER:
lowerBound = WindowRange();
break;
default:
jj_la1[129] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
break;
default:
jj_la1[130] = jj_gen;
;
}
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case ALLOW:
case DISALLOW:
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case ALLOW:
jj_consume_token(ALLOW);
s2 = span();
jj_consume_token(PARTIAL);
allowPartial = SqlLiteral.createBoolean(true, s2.end(this));
break;
case DISALLOW:
jj_consume_token(DISALLOW);
s2 = span();
jj_consume_token(PARTIAL);
allowPartial = SqlLiteral.createBoolean(false, s2.end(this));
break;
default:
jj_la1[131] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
break;
default:
jj_la1[132] = jj_gen;
;
}
jj_consume_token(RPAREN);
{if (true) return SqlWindow.create(
null, id, partitionList, orderList,
isRows, lowerBound, upperBound, allowPartial, s.end(this));}
throw new Error("Missing return statement in function");
}
final public SqlNode WindowRange() throws ParseException {
final SqlNode e;
final Span s;
if (jj_2_26(2)) {
jj_consume_token(CURRENT);
s = span();
jj_consume_token(ROW);
{if (true) return SqlWindow.createCurrentRow(s.end(this));}
} else if (jj_2_27(2)) {
jj_consume_token(UNBOUNDED);
s = span();
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case PRECEDING:
jj_consume_token(PRECEDING);
{if (true) return SqlWindow.createUnboundedPreceding(s.end(this));}
break;
case FOLLOWING:
jj_consume_token(FOLLOWING);
{if (true) return SqlWindow.createUnboundedFollowing(s.end(this));}
break;
default:
jj_la1[133] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
} else {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case A:
case ABS:
case ABSENT:
case ABSOLUTE:
case ACTION:
case ADA:
case ADD:
case ADMIN:
case AFTER:
case ALWAYS:
case APPLY:
case ARRAY:
case ASC:
case ASSERTION:
case ASSIGNMENT:
case ATTRIBUTE:
case ATTRIBUTES:
case AVG:
case BEFORE:
case BERNOULLI:
case BREADTH:
case C:
case CARDINALITY:
case CASCADE:
case CASE:
case CAST:
case CATALOG:
case CATALOG_NAME:
case CEIL:
case CEILING:
case CENTURY:
case CHAIN:
case CHAR_LENGTH:
case CHARACTER_LENGTH:
case CHARACTER_SET_CATALOG:
case CHARACTER_SET_NAME:
case CHARACTER_SET_SCHEMA:
case CHARACTERISTICS:
case CHARACTERS:
case CLASSIFIER:
case CLASS_ORIGIN:
case COALESCE:
case COBOL:
case COLLATION:
case COLLATION_CATALOG:
case COLLATION_NAME:
case COLLATION_SCHEMA:
case COLLECT:
case COLUMN_NAME:
case COMMAND_FUNCTION:
case COMMAND_FUNCTION_CODE:
case COMMITTED:
case CONDITIONAL:
case CONDITION_NUMBER:
case CONNECTION:
case CONNECTION_NAME:
case CONSTRAINT_CATALOG:
case CONSTRAINT_NAME:
case CONSTRAINT_SCHEMA:
case CONSTRAINTS:
case CONSTRUCTOR:
case CONTINUE:
case CONVERT:
case COUNT:
case COVAR_POP:
case COVAR_SAMP:
case CUME_DIST:
case CURRENT:
case CURRENT_CATALOG:
case CURRENT_DATE:
case CURRENT_DEFAULT_TRANSFORM_GROUP:
case CURRENT_PATH:
case CURRENT_ROLE:
case CURRENT_SCHEMA:
case CURRENT_TIME:
case CURRENT_TIMESTAMP:
case CURRENT_USER:
case CURSOR:
case CURSOR_NAME:
case DATA:
case DATABASE:
case DATE:
case DATETIME_INTERVAL_CODE:
case DATETIME_INTERVAL_PRECISION:
case DECADE:
case DEFAULTS:
case DEFERRABLE:
case DEFERRED:
case DEFINED:
case DEFINER:
case DEGREE:
case DENSE_RANK:
case DEPTH:
case DERIVED:
case DESC:
case DESCRIPTION:
case DESCRIPTOR:
case DIAGNOSTICS:
case DISPATCH:
case DOMAIN:
case DOW:
case DOY:
case DYNAMIC_FUNCTION:
case DYNAMIC_FUNCTION_CODE:
case ELEMENT:
case ENCODING:
case EPOCH:
case ERROR:
case EXCEPTION:
case EXCLUDE:
case EXCLUDING:
case EXISTS:
case EXP:
case EXTRACT:
case FALSE:
case FINAL:
case FIRST:
case FIRST_VALUE:
case FLOOR:
case FOLLOWING:
case FORMAT:
case FORTRAN:
case FOUND:
case FRAC_SECOND:
case FUSION:
case G:
case GENERAL:
case GENERATED:
case GEOMETRY:
case GO:
case GOTO:
case GRANTED:
case GROUPING:
case HIERARCHY:
case HOUR:
case IGNORE:
case IMMEDIATE:
case IMMEDIATELY:
case IMPLEMENTATION:
case INCLUDING:
case INCREMENT:
case INITIALLY:
case INPUT:
case INSTANCE:
case INSTANTIABLE:
case INTERVAL:
case INVOKER:
case ISODOW:
case ISOYEAR:
case ISOLATION:
case JAVA:
case JSON:
case JSON_ARRAY:
case JSON_ARRAYAGG:
case JSON_EXISTS:
case JSON_OBJECT:
case JSON_OBJECTAGG:
case JSON_QUERY:
case JSON_VALUE:
case K:
case KEY:
case KEY_MEMBER:
case KEY_TYPE:
case LABEL:
case LAG:
case LAST:
case LAST_VALUE:
case LEAD:
case LEFT:
case LENGTH:
case LEVEL:
case LIBRARY:
case LN:
case LOCALTIME:
case LOCALTIMESTAMP:
case LOCATOR:
case LOWER:
case M:
case MAP:
case MATCHED:
case MATCH_NUMBER:
case MAX:
case MAXVALUE:
case MESSAGE_LENGTH:
case MESSAGE_OCTET_LENGTH:
case MESSAGE_TEXT:
case MICROSECOND:
case MILLISECOND:
case MILLENNIUM:
case MIN:
case MINUTE:
case MINVALUE:
case MOD:
case MONTH:
case MORE_:
case MULTISET:
case MUMPS:
case NAME:
case NAMES:
case NANOSECOND:
case NESTING:
case NEW:
case NEXT:
case NORMALIZED:
case NOT:
case NTH_VALUE:
case NTILE:
case NULL:
case NULLABLE:
case NULLIF:
case NULLS:
case NUMBER:
case OBJECT:
case OCTET_LENGTH:
case OCTETS:
case OPTION:
case OPTIONS:
case ORDERING:
case ORDINALITY:
case OTHERS:
case OUTPUT:
case OVERLAY:
case OVERRIDING:
case PAD:
case PARAMETER_MODE:
case PARAMETER_NAME:
case PARAMETER_ORDINAL_POSITION:
case PARAMETER_SPECIFIC_CATALOG:
case PARAMETER_SPECIFIC_NAME:
case PARAMETER_SPECIFIC_SCHEMA:
case PARTIAL:
case PASCAL:
case PASSING:
case PASSTHROUGH:
case PAST:
case PATH:
case PERCENT_RANK:
case PERIOD:
case PLACING:
case PLAN:
case PLI:
case POSITION:
case POWER:
case PRECEDING:
case PRESERVE:
case PREV:
case PRIOR:
case PRIVILEGES:
case PUBLIC:
case QUARTER:
case RANK:
case READ:
case REGR_COUNT:
case REGR_SXX:
case REGR_SYY:
case RELATIVE:
case REPEATABLE:
case REPLACE:
case RESPECT:
case RESTART:
case RESTRICT:
case RETURNED_CARDINALITY:
case RETURNED_LENGTH:
case RETURNED_OCTET_LENGTH:
case RETURNED_SQLSTATE:
case RETURNING:
case RIGHT:
case ROLE:
case ROUTINE:
case ROUTINE_CATALOG:
case ROUTINE_NAME:
case ROUTINE_SCHEMA:
case ROW:
case ROW_COUNT:
case ROW_NUMBER:
case RUNNING:
case SCALAR:
case SCALE:
case SCHEMA:
case SCHEMA_NAME:
case SCOPE_CATALOGS:
case SCOPE_NAME:
case SCOPE_SCHEMA:
case SECOND:
case SECTION:
case SECURITY:
case SELF:
case SEQUENCE:
case SERIALIZABLE:
case SERVER:
case SERVER_NAME:
case SESSION:
case SESSION_USER:
case SETS:
case SIMPLE:
case SIZE:
case SOURCE:
case SPACE:
case SPECIFIC:
case SPECIFIC_NAME:
case SQL_BIGINT:
case SQL_BINARY:
case SQL_BIT:
case SQL_BLOB:
case SQL_BOOLEAN:
case SQL_CHAR:
case SQL_CLOB:
case SQL_DATE:
case SQL_DECIMAL:
case SQL_DOUBLE:
case SQL_FLOAT:
case SQL_INTEGER:
case SQL_INTERVAL_DAY:
case SQL_INTERVAL_DAY_TO_HOUR:
case SQL_INTERVAL_DAY_TO_MINUTE:
case SQL_INTERVAL_DAY_TO_SECOND:
case SQL_INTERVAL_HOUR:
case SQL_INTERVAL_HOUR_TO_MINUTE:
case SQL_INTERVAL_HOUR_TO_SECOND:
case SQL_INTERVAL_MINUTE:
case SQL_INTERVAL_MINUTE_TO_SECOND:
case SQL_INTERVAL_MONTH:
case SQL_INTERVAL_SECOND:
case SQL_INTERVAL_YEAR:
case SQL_INTERVAL_YEAR_TO_MONTH:
case SQL_LONGVARBINARY:
case SQL_LONGVARCHAR:
case SQL_LONGVARNCHAR:
case SQL_NCHAR:
case SQL_NCLOB:
case SQL_NUMERIC:
case SQL_NVARCHAR:
case SQL_REAL:
case SQL_SMALLINT:
case SQL_TIME:
case SQL_TIMESTAMP:
case SQL_TINYINT:
case SQL_TSI_DAY:
case SQL_TSI_FRAC_SECOND:
case SQL_TSI_HOUR:
case SQL_TSI_MICROSECOND:
case SQL_TSI_MINUTE:
case SQL_TSI_MONTH:
case SQL_TSI_QUARTER:
case SQL_TSI_SECOND:
case SQL_TSI_WEEK:
case SQL_TSI_YEAR:
case SQL_VARBINARY:
case SQL_VARCHAR:
case SQRT:
case STATE:
case STATEMENT:
case STDDEV_POP:
case STDDEV_SAMP:
case STRUCTURE:
case STYLE:
case SUBCLASS_ORIGIN:
case SUBSTITUTE:
case SUBSTRING:
case SUM:
case SYSTEM_USER:
case TABLE_NAME:
case TEMPORARY:
case TIES:
case TIME:
case TIMESTAMP:
case TIMESTAMPADD:
case TIMESTAMPDIFF:
case TOP_LEVEL_COUNT:
case TRANSACTION:
case TRANSACTIONS_ACTIVE:
case TRANSACTIONS_COMMITTED:
case TRANSACTIONS_ROLLED_BACK:
case TRANSFORM:
case TRANSFORMS:
case TRANSLATE:
case TRIGGER_CATALOG:
case TRIGGER_NAME:
case TRIGGER_SCHEMA:
case TRIM:
case TRUE:
case TRUNCATE:
case TYPE:
case UNBOUNDED:
case UNCOMMITTED:
case UNCONDITIONAL:
case UNDER:
case UNKNOWN:
case UNNAMED:
case UPPER:
case USAGE:
case USER:
case USER_DEFINED_TYPE_CATALOG:
case USER_DEFINED_TYPE_CODE:
case USER_DEFINED_TYPE_NAME:
case USER_DEFINED_TYPE_SCHEMA:
case UTF8:
case UTF16:
case UTF32:
case VAR_POP:
case VAR_SAMP:
case VERSION:
case VIEW:
case WEEK:
case WORK:
case WRAPPER:
case WRITE:
case XML:
case YEAR:
case ZONE:
case IF:
case MATERIALIZED:
case STORED:
case VIRTUAL:
case JAR:
case FILE:
case ARCHIVE:
case UNSIGNED_INTEGER_LITERAL:
case APPROX_NUMERIC_LITERAL:
case DECIMAL_NUMERIC_LITERAL:
case BINARY_STRING_LITERAL:
case QUOTED_STRING:
case PREFIXED_STRING_LITERAL:
case UNICODE_STRING_LITERAL:
case LPAREN:
case LBRACE_D:
case LBRACE_T:
case LBRACE_TS:
case LBRACE_FN:
case HOOK:
case PLUS:
case MINUS:
case BRACKET_QUOTED_IDENTIFIER:
case QUOTED_IDENTIFIER:
case BACK_QUOTED_IDENTIFIER:
case IDENTIFIER:
case UNICODE_QUOTED_IDENTIFIER:
e = Expression(ExprContext.ACCEPT_NON_QUERY);
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case PRECEDING:
jj_consume_token(PRECEDING);
{if (true) return SqlWindow.createPreceding(e, getPos());}
break;
case FOLLOWING:
jj_consume_token(FOLLOWING);
{if (true) return SqlWindow.createFollowing(e, getPos());}
break;
default:
jj_la1[134] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
break;
default:
jj_la1[135] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
}
throw new Error("Missing return statement in function");
}
/**
* Parses an ORDER BY clause.
*/
final public SqlNodeList OrderBy(boolean accept) throws ParseException {
List list;
SqlNode e;
final Span s;
jj_consume_token(ORDER);
s = span();
if (!accept) {
// Someone told us ORDER BY wasn't allowed here. So why
// did they bother calling us? To get the correct
// parser position for error reporting.
{if (true) throw SqlUtil.newContextException(s.pos(), RESOURCE.illegalOrderBy());}
}
jj_consume_token(BY);
e = OrderItem();
list = startList(e);
label_19:
while (true) {
if (jj_2_28(2)) {
;
} else {
break label_19;
}
jj_consume_token(COMMA);
e = OrderItem();
list.add(e);
}
{if (true) return new SqlNodeList(list, s.addAll(list).pos());}
throw new Error("Missing return statement in function");
}
/**
* Parses one list item in an ORDER BY clause.
*/
final public SqlNode OrderItem() throws ParseException {
SqlNode e;
e = Expression(ExprContext.ACCEPT_SUB_QUERY);
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case ASC:
case DESC:
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case ASC:
jj_consume_token(ASC);
break;
case DESC:
jj_consume_token(DESC);
e = SqlStdOperatorTable.DESC.createCall(getPos(), e);
break;
default:
jj_la1[136] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
break;
default:
jj_la1[137] = jj_gen;
;
}
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case NULLS:
if (jj_2_29(2)) {
jj_consume_token(NULLS);
jj_consume_token(FIRST);
e = SqlStdOperatorTable.NULLS_FIRST.createCall(getPos(), e);
} else {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case NULLS:
jj_consume_token(NULLS);
jj_consume_token(LAST);
e = SqlStdOperatorTable.NULLS_LAST.createCall(getPos(), e);
break;
default:
jj_la1[138] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
}
break;
default:
jj_la1[139] = jj_gen;
;
}
{if (true) return e;}
throw new Error("Missing return statement in function");
}
/**
* Parses a FOR SYSTEM_TIME clause following a table expression.
*/
final public SqlSnapshot Snapshot(SqlNode tableRef) throws ParseException {
final Span s;
final SqlNode e;
jj_consume_token(FOR);
s = span();
jj_consume_token(SYSTEM_TIME);
jj_consume_token(AS);
jj_consume_token(OF);
e = Expression(ExprContext.ACCEPT_NON_QUERY);
{if (true) return new SqlSnapshot(s.end(this), tableRef, e);}
throw new Error("Missing return statement in function");
}
/**
* Parses a MATCH_RECOGNIZE clause following a table expression.
*/
final public SqlMatchRecognize MatchRecognize(SqlNode tableRef) throws ParseException {
final Span s, s0, s1, s2;
SqlNodeList measureList = SqlNodeList.EMPTY;
SqlNodeList partitionList = SqlNodeList.EMPTY;
SqlNodeList orderList = SqlNodeList.EMPTY;
SqlNode pattern;
SqlLiteral interval;
SqlNodeList patternDefList;
final SqlNode after;
SqlParserPos pos;
final SqlNode var;
final SqlLiteral rowsPerMatch;
SqlNodeList subsetList = SqlNodeList.EMPTY;
SqlLiteral isStrictStarts = SqlLiteral.createBoolean(false, getPos());
SqlLiteral isStrictEnds = SqlLiteral.createBoolean(false, getPos());
jj_consume_token(MATCH_RECOGNIZE);
s = span();
jj_consume_token(LPAREN);
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case PARTITION:
jj_consume_token(PARTITION);
s2 = span();
jj_consume_token(BY);
partitionList = ExpressionCommaList(s2, ExprContext.ACCEPT_NON_QUERY);
break;
default:
jj_la1[140] = jj_gen;
;
}
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case ORDER:
orderList = OrderBy(true);
break;
default:
jj_la1[141] = jj_gen;
;
}
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case MEASURES:
jj_consume_token(MEASURES);
measureList = MeasureColumnCommaList(span());
break;
default:
jj_la1[142] = jj_gen;
;
}
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case ONE:
jj_consume_token(ONE);
s0 = span();
jj_consume_token(ROW);
jj_consume_token(PER);
jj_consume_token(MATCH);
rowsPerMatch = SqlMatchRecognize.RowsPerMatchOption.ONE_ROW.symbol(s0.end(this));
break;
case ALL:
jj_consume_token(ALL);
s0 = span();
jj_consume_token(ROWS);
jj_consume_token(PER);
jj_consume_token(MATCH);
rowsPerMatch = SqlMatchRecognize.RowsPerMatchOption.ALL_ROWS.symbol(s0.end(this));
break;
default:
jj_la1[143] = jj_gen;
rowsPerMatch = null;
}
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case AFTER:
jj_consume_token(AFTER);
s1 = span();
jj_consume_token(MATCH);
jj_consume_token(SKIP_);
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case TO:
jj_consume_token(TO);
if (jj_2_31(2)) {
jj_consume_token(NEXT);
jj_consume_token(ROW);
after = SqlMatchRecognize.AfterOption.SKIP_TO_NEXT_ROW
.symbol(s1.end(this));
} else if (jj_2_32(2)) {
jj_consume_token(FIRST);
var = SimpleIdentifier();
after = SqlMatchRecognize.SKIP_TO_FIRST.createCall(
s1.end(var), var);
} else if (true) {
if (jj_2_30(2)) {
jj_consume_token(LAST);
} else {
;
}
var = SimpleIdentifier();
after = SqlMatchRecognize.SKIP_TO_LAST.createCall(
s1.end(var), var);
} else {
jj_consume_token(-1);
throw new ParseException();
}
break;
case PAST:
jj_consume_token(PAST);
jj_consume_token(LAST);
jj_consume_token(ROW);
after = SqlMatchRecognize.AfterOption.SKIP_PAST_LAST_ROW
.symbol(s1.end(this));
break;
default:
jj_la1[144] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
break;
default:
jj_la1[145] = jj_gen;
after = null;
}
jj_consume_token(PATTERN);
jj_consume_token(LPAREN);
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case CARET:
jj_consume_token(CARET);
isStrictStarts = SqlLiteral.createBoolean(true, getPos());
break;
default:
jj_la1[146] = jj_gen;
isStrictStarts = SqlLiteral.createBoolean(false, getPos());
}
pattern = PatternExpression();
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case DOLLAR:
jj_consume_token(DOLLAR);
isStrictEnds = SqlLiteral.createBoolean(true, getPos());
break;
default:
jj_la1[147] = jj_gen;
isStrictEnds = SqlLiteral.createBoolean(false, getPos());
}
jj_consume_token(RPAREN);
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case WITHIN:
jj_consume_token(WITHIN);
interval = IntervalLiteral();
break;
default:
jj_la1[148] = jj_gen;
interval = null;
}
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case SUBSET:
jj_consume_token(SUBSET);
subsetList = SubsetDefinitionCommaList(span());
break;
default:
jj_la1[149] = jj_gen;
;
}
jj_consume_token(DEFINE);
patternDefList = PatternDefinitionCommaList(span());
jj_consume_token(RPAREN);
{if (true) return new SqlMatchRecognize(s.end(this), tableRef,
pattern, isStrictStarts, isStrictEnds, patternDefList, measureList,
after, subsetList, rowsPerMatch, partitionList, orderList, interval);}
throw new Error("Missing return statement in function");
}
final public SqlNodeList MeasureColumnCommaList(Span s) throws ParseException {
SqlNode e;
final List eList = new ArrayList();
e = MeasureColumn();
eList.add(e);
label_20:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case COMMA:
;
break;
default:
jj_la1[150] = jj_gen;
break label_20;
}
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 SqlNode MeasureColumn() throws ParseException {
SqlNode e;
SqlIdentifier alias;
e = Expression(ExprContext.ACCEPT_NON_QUERY);
jj_consume_token(AS);
alias = SimpleIdentifier();
{if (true) return SqlStdOperatorTable.AS.createCall(Span.of(e).end(this), e, alias);}
throw new Error("Missing return statement in function");
}
final public SqlNode PatternExpression() throws ParseException {
SqlNode left;
SqlNode right;
left = PatternTerm();
label_21:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case VERTICAL_BAR:
;
break;
default:
jj_la1[151] = jj_gen;
break label_21;
}
jj_consume_token(VERTICAL_BAR);
right = PatternTerm();
left = SqlStdOperatorTable.PATTERN_ALTER.createCall(
Span.of(left).end(right), left, right);
}
{if (true) return left;}
throw new Error("Missing return statement in function");
}
final public SqlNode PatternTerm() throws ParseException {
SqlNode left;
SqlNode right;
left = PatternFactor();
label_22:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case A:
case ABSENT:
case ABSOLUTE:
case ACTION:
case ADA:
case ADD:
case ADMIN:
case AFTER:
case ALWAYS:
case APPLY:
case ASC:
case ASSERTION:
case ASSIGNMENT:
case ATTRIBUTE:
case ATTRIBUTES:
case BEFORE:
case BERNOULLI:
case BREADTH:
case C:
case CASCADE:
case CATALOG:
case CATALOG_NAME:
case CENTURY:
case CHAIN:
case CHARACTER_SET_CATALOG:
case CHARACTER_SET_NAME:
case CHARACTER_SET_SCHEMA:
case CHARACTERISTICS:
case CHARACTERS:
case CLASS_ORIGIN:
case COBOL:
case COLLATION:
case COLLATION_CATALOG:
case COLLATION_NAME:
case COLLATION_SCHEMA:
case COLUMN_NAME:
case COMMAND_FUNCTION:
case COMMAND_FUNCTION_CODE:
case COMMITTED:
case CONDITIONAL:
case CONDITION_NUMBER:
case CONNECTION:
case CONNECTION_NAME:
case CONSTRAINT_CATALOG:
case CONSTRAINT_NAME:
case CONSTRAINT_SCHEMA:
case CONSTRAINTS:
case CONSTRUCTOR:
case CONTINUE:
case CURSOR_NAME:
case DATA:
case DATABASE:
case DATETIME_INTERVAL_CODE:
case DATETIME_INTERVAL_PRECISION:
case DECADE:
case DEFAULTS:
case DEFERRABLE:
case DEFERRED:
case DEFINED:
case DEFINER:
case DEGREE:
case DEPTH:
case DERIVED:
case DESC:
case DESCRIPTION:
case DESCRIPTOR:
case DIAGNOSTICS:
case DISPATCH:
case DOMAIN:
case DOW:
case DOY:
case DYNAMIC_FUNCTION:
case DYNAMIC_FUNCTION_CODE:
case ENCODING:
case EPOCH:
case ERROR:
case EXCEPTION:
case EXCLUDE:
case EXCLUDING:
case FINAL:
case FIRST:
case FOLLOWING:
case FORMAT:
case FORTRAN:
case FOUND:
case FRAC_SECOND:
case G:
case GENERAL:
case GENERATED:
case GEOMETRY:
case GO:
case GOTO:
case GRANTED:
case HIERARCHY:
case IGNORE:
case IMMEDIATE:
case IMMEDIATELY:
case IMPLEMENTATION:
case INCLUDING:
case INCREMENT:
case INITIALLY:
case INPUT:
case INSTANCE:
case INSTANTIABLE:
case INVOKER:
case ISODOW:
case ISOYEAR:
case ISOLATION:
case JAVA:
case JSON:
case K:
case KEY:
case KEY_MEMBER:
case KEY_TYPE:
case LABEL:
case LAST:
case LENGTH:
case LEVEL:
case LIBRARY:
case LOCATOR:
case M:
case MAP:
case MATCHED:
case MAXVALUE:
case MESSAGE_LENGTH:
case MESSAGE_OCTET_LENGTH:
case MESSAGE_TEXT:
case MICROSECOND:
case MILLISECOND:
case MILLENNIUM:
case MINVALUE:
case MORE_:
case MUMPS:
case NAME:
case NAMES:
case NANOSECOND:
case NESTING:
case NORMALIZED:
case NULLABLE:
case NULLS:
case NUMBER:
case OBJECT:
case OCTETS:
case OPTION:
case OPTIONS:
case ORDERING:
case ORDINALITY:
case OTHERS:
case OUTPUT:
case OVERRIDING:
case PAD:
case PARAMETER_MODE:
case PARAMETER_NAME:
case PARAMETER_ORDINAL_POSITION:
case PARAMETER_SPECIFIC_CATALOG:
case PARAMETER_SPECIFIC_NAME:
case PARAMETER_SPECIFIC_SCHEMA:
case PARTIAL:
case PASCAL:
case PASSING:
case PASSTHROUGH:
case PAST:
case PATH:
case PERMUTE:
case PLACING:
case PLAN:
case PLI:
case PRECEDING:
case PRESERVE:
case PRIOR:
case PRIVILEGES:
case PUBLIC:
case QUARTER:
case READ:
case RELATIVE:
case REPEATABLE:
case REPLACE:
case RESPECT:
case RESTART:
case RESTRICT:
case RETURNED_CARDINALITY:
case RETURNED_LENGTH:
case RETURNED_OCTET_LENGTH:
case RETURNED_SQLSTATE:
case RETURNING:
case ROLE:
case ROUTINE:
case ROUTINE_CATALOG:
case ROUTINE_NAME:
case ROUTINE_SCHEMA:
case ROW_COUNT:
case SCALAR:
case SCALE:
case SCHEMA:
case SCHEMA_NAME:
case SCOPE_CATALOGS:
case SCOPE_NAME:
case SCOPE_SCHEMA:
case SECTION:
case SECURITY:
case SELF:
case SEQUENCE:
case SERIALIZABLE:
case SERVER:
case SERVER_NAME:
case SESSION:
case SETS:
case SIMPLE:
case SIZE:
case SOURCE:
case SPACE:
case SPECIFIC_NAME:
case SQL_BIGINT:
case SQL_BINARY:
case SQL_BIT:
case SQL_BLOB:
case SQL_BOOLEAN:
case SQL_CHAR:
case SQL_CLOB:
case SQL_DATE:
case SQL_DECIMAL:
case SQL_DOUBLE:
case SQL_FLOAT:
case SQL_INTEGER:
case SQL_INTERVAL_DAY:
case SQL_INTERVAL_DAY_TO_HOUR:
case SQL_INTERVAL_DAY_TO_MINUTE:
case SQL_INTERVAL_DAY_TO_SECOND:
case SQL_INTERVAL_HOUR:
case SQL_INTERVAL_HOUR_TO_MINUTE:
case SQL_INTERVAL_HOUR_TO_SECOND:
case SQL_INTERVAL_MINUTE:
case SQL_INTERVAL_MINUTE_TO_SECOND:
case SQL_INTERVAL_MONTH:
case SQL_INTERVAL_SECOND:
case SQL_INTERVAL_YEAR:
case SQL_INTERVAL_YEAR_TO_MONTH:
case SQL_LONGVARBINARY:
case SQL_LONGVARCHAR:
case SQL_LONGVARNCHAR:
case SQL_NCHAR:
case SQL_NCLOB:
case SQL_NUMERIC:
case SQL_NVARCHAR:
case SQL_REAL:
case SQL_SMALLINT:
case SQL_TIME:
case SQL_TIMESTAMP:
case SQL_TINYINT:
case SQL_TSI_DAY:
case SQL_TSI_FRAC_SECOND:
case SQL_TSI_HOUR:
case SQL_TSI_MICROSECOND:
case SQL_TSI_MINUTE:
case SQL_TSI_MONTH:
case SQL_TSI_QUARTER:
case SQL_TSI_SECOND:
case SQL_TSI_WEEK:
case SQL_TSI_YEAR:
case SQL_VARBINARY:
case SQL_VARCHAR:
case STATE:
case STATEMENT:
case STRUCTURE:
case STYLE:
case SUBCLASS_ORIGIN:
case SUBSTITUTE:
case TABLE_NAME:
case TEMPORARY:
case TIES:
case TIMESTAMPADD:
case TIMESTAMPDIFF:
case TOP_LEVEL_COUNT:
case TRANSACTION:
case TRANSACTIONS_ACTIVE:
case TRANSACTIONS_COMMITTED:
case TRANSACTIONS_ROLLED_BACK:
case TRANSFORM:
case TRANSFORMS:
case TRIGGER_CATALOG:
case TRIGGER_NAME:
case TRIGGER_SCHEMA:
case TYPE:
case UNBOUNDED:
case UNCOMMITTED:
case UNCONDITIONAL:
case UNDER:
case UNNAMED:
case USAGE:
case USER_DEFINED_TYPE_CATALOG:
case USER_DEFINED_TYPE_CODE:
case USER_DEFINED_TYPE_NAME:
case USER_DEFINED_TYPE_SCHEMA:
case UTF8:
case UTF16:
case UTF32:
case VERSION:
case VIEW:
case WEEK:
case WORK:
case WRAPPER:
case WRITE:
case XML:
case ZONE:
case IF:
case MATERIALIZED:
case STORED:
case VIRTUAL:
case JAR:
case FILE:
case ARCHIVE:
case LPAREN:
case LBRACE:
case BRACKET_QUOTED_IDENTIFIER:
case QUOTED_IDENTIFIER:
case BACK_QUOTED_IDENTIFIER:
case IDENTIFIER:
case UNICODE_QUOTED_IDENTIFIER:
;
break;
default:
jj_la1[152] = jj_gen;
break label_22;
}
right = PatternFactor();
left = SqlStdOperatorTable.PATTERN_CONCAT.createCall(
Span.of(left).end(right), left, right);
}
{if (true) return left;}
throw new Error("Missing return statement in function");
}
final public SqlNode PatternFactor() throws ParseException {
SqlNode e;
SqlNode extra;
SqlLiteral startNum = null;
SqlLiteral endNum = null;
SqlLiteral reluctant = SqlLiteral.createBoolean(false, SqlParserPos.ZERO);
e = PatternPrimary();
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case LBRACE:
case HOOK:
case PLUS:
case STAR:
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case STAR:
jj_consume_token(STAR);
startNum = SqlLiteral.createExactNumeric("0", SqlParserPos.ZERO);
endNum = SqlLiteral.createExactNumeric("-1", SqlParserPos.ZERO);
break;
case PLUS:
jj_consume_token(PLUS);
startNum = SqlLiteral.createExactNumeric("1", SqlParserPos.ZERO);
endNum = SqlLiteral.createExactNumeric("-1", SqlParserPos.ZERO);
break;
case HOOK:
jj_consume_token(HOOK);
startNum = SqlLiteral.createExactNumeric("0", SqlParserPos.ZERO);
endNum = SqlLiteral.createExactNumeric("1", SqlParserPos.ZERO);
break;
case LBRACE:
jj_consume_token(LBRACE);
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case UNSIGNED_INTEGER_LITERAL:
case APPROX_NUMERIC_LITERAL:
case DECIMAL_NUMERIC_LITERAL:
startNum = UnsignedNumericLiteral();
endNum = startNum;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case COMMA:
jj_consume_token(COMMA);
endNum = SqlLiteral.createExactNumeric("-1", SqlParserPos.ZERO);
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case UNSIGNED_INTEGER_LITERAL:
case APPROX_NUMERIC_LITERAL:
case DECIMAL_NUMERIC_LITERAL:
endNum = UnsignedNumericLiteral();
break;
default:
jj_la1[153] = jj_gen;
;
}
break;
default:
jj_la1[154] = jj_gen;
;
}
jj_consume_token(RBRACE);
break;
case COMMA:
startNum = SqlLiteral.createExactNumeric("-1", SqlParserPos.ZERO);
jj_consume_token(COMMA);
endNum = UnsignedNumericLiteral();
jj_consume_token(RBRACE);
break;
case MINUS:
jj_consume_token(MINUS);
extra = PatternExpression();
jj_consume_token(MINUS);
jj_consume_token(RBRACE);
extra = SqlStdOperatorTable.PATTERN_EXCLUDE.createCall(
Span.of(extra).end(this), extra);
e = SqlStdOperatorTable.PATTERN_CONCAT.createCall(
Span.of(e).end(this), e, extra);
{if (true) return e;}
break;
default:
jj_la1[155] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
break;
default:
jj_la1[156] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case HOOK:
jj_consume_token(HOOK);
if (startNum.intValue(true) != endNum.intValue(true)) {
reluctant = SqlLiteral.createBoolean(true, SqlParserPos.ZERO);
}
break;
default:
jj_la1[157] = jj_gen;
;
}
break;
default:
jj_la1[158] = jj_gen;
;
}
if (startNum == null) {
{if (true) return e;}
} else {
{if (true) return SqlStdOperatorTable.PATTERN_QUANTIFIER.createCall(
span().end(e), e, startNum, endNum, reluctant);}
}
throw new Error("Missing return statement in function");
}
final public SqlNode PatternPrimary() throws ParseException {
final Span s;
SqlNode e;
List eList;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case A:
case ABSENT:
case ABSOLUTE:
case ACTION:
case ADA:
case ADD:
case ADMIN:
case AFTER:
case ALWAYS:
case APPLY:
case ASC:
case ASSERTION:
case ASSIGNMENT:
case ATTRIBUTE:
case ATTRIBUTES:
case BEFORE:
case BERNOULLI:
case BREADTH:
case C:
case CASCADE:
case CATALOG:
case CATALOG_NAME:
case CENTURY:
case CHAIN:
case CHARACTER_SET_CATALOG:
case CHARACTER_SET_NAME:
case CHARACTER_SET_SCHEMA:
case CHARACTERISTICS:
case CHARACTERS:
case CLASS_ORIGIN:
case COBOL:
case COLLATION:
case COLLATION_CATALOG:
case COLLATION_NAME:
case COLLATION_SCHEMA:
case COLUMN_NAME:
case COMMAND_FUNCTION:
case COMMAND_FUNCTION_CODE:
case COMMITTED:
case CONDITIONAL:
case CONDITION_NUMBER:
case CONNECTION:
case CONNECTION_NAME:
case CONSTRAINT_CATALOG:
case CONSTRAINT_NAME:
case CONSTRAINT_SCHEMA:
case CONSTRAINTS:
case CONSTRUCTOR:
case CONTINUE:
case CURSOR_NAME:
case DATA:
case DATABASE:
case DATETIME_INTERVAL_CODE:
case DATETIME_INTERVAL_PRECISION:
case DECADE:
case DEFAULTS:
case DEFERRABLE:
case DEFERRED:
case DEFINED:
case DEFINER:
case DEGREE:
case DEPTH:
case DERIVED:
case DESC:
case DESCRIPTION:
case DESCRIPTOR:
case DIAGNOSTICS:
case DISPATCH:
case DOMAIN:
case DOW:
case DOY:
case DYNAMIC_FUNCTION:
case DYNAMIC_FUNCTION_CODE:
case ENCODING:
case EPOCH:
case ERROR:
case EXCEPTION:
case EXCLUDE:
case EXCLUDING:
case FINAL:
case FIRST:
case FOLLOWING:
case FORMAT:
case FORTRAN:
case FOUND:
case FRAC_SECOND:
case G:
case GENERAL:
case GENERATED:
case GEOMETRY:
case GO:
case GOTO:
case GRANTED:
case HIERARCHY:
case IGNORE:
case IMMEDIATE:
case IMMEDIATELY:
case IMPLEMENTATION:
case INCLUDING:
case INCREMENT:
case INITIALLY:
case INPUT:
case INSTANCE:
case INSTANTIABLE:
case INVOKER:
case ISODOW:
case ISOYEAR:
case ISOLATION:
case JAVA:
case JSON:
case K:
case KEY:
case KEY_MEMBER:
case KEY_TYPE:
case LABEL:
case LAST:
case LENGTH:
case LEVEL:
case LIBRARY:
case LOCATOR:
case M:
case MAP:
case MATCHED:
case MAXVALUE:
case MESSAGE_LENGTH:
case MESSAGE_OCTET_LENGTH:
case MESSAGE_TEXT:
case MICROSECOND:
case MILLISECOND:
case MILLENNIUM:
case MINVALUE:
case MORE_:
case MUMPS:
case NAME:
case NAMES:
case NANOSECOND:
case NESTING:
case NORMALIZED:
case NULLABLE:
case NULLS:
case NUMBER:
case OBJECT:
case OCTETS:
case OPTION:
case OPTIONS:
case ORDERING:
case ORDINALITY:
case OTHERS:
case OUTPUT:
case OVERRIDING:
case PAD:
case PARAMETER_MODE:
case PARAMETER_NAME:
case PARAMETER_ORDINAL_POSITION:
case PARAMETER_SPECIFIC_CATALOG:
case PARAMETER_SPECIFIC_NAME:
case PARAMETER_SPECIFIC_SCHEMA:
case PARTIAL:
case PASCAL:
case PASSING:
case PASSTHROUGH:
case PAST:
case PATH:
case PLACING:
case PLAN:
case PLI:
case PRECEDING:
case PRESERVE:
case PRIOR:
case PRIVILEGES:
case PUBLIC:
case QUARTER:
case READ:
case RELATIVE:
case REPEATABLE:
case REPLACE:
case RESPECT:
case RESTART:
case RESTRICT:
case RETURNED_CARDINALITY:
case RETURNED_LENGTH:
case RETURNED_OCTET_LENGTH:
case RETURNED_SQLSTATE:
case RETURNING:
case ROLE:
case ROUTINE:
case ROUTINE_CATALOG:
case ROUTINE_NAME:
case ROUTINE_SCHEMA:
case ROW_COUNT:
case SCALAR:
case SCALE:
case SCHEMA:
case SCHEMA_NAME:
case SCOPE_CATALOGS:
case SCOPE_NAME:
case SCOPE_SCHEMA:
case SECTION:
case SECURITY:
case SELF:
case SEQUENCE:
case SERIALIZABLE:
case SERVER:
case SERVER_NAME:
case SESSION:
case SETS:
case SIMPLE:
case SIZE:
case SOURCE:
case SPACE:
case SPECIFIC_NAME:
case SQL_BIGINT:
case SQL_BINARY:
case SQL_BIT:
case SQL_BLOB:
case SQL_BOOLEAN:
case SQL_CHAR:
case SQL_CLOB:
case SQL_DATE:
case SQL_DECIMAL:
case SQL_DOUBLE:
case SQL_FLOAT:
case SQL_INTEGER:
case SQL_INTERVAL_DAY:
case SQL_INTERVAL_DAY_TO_HOUR:
case SQL_INTERVAL_DAY_TO_MINUTE:
case SQL_INTERVAL_DAY_TO_SECOND:
case SQL_INTERVAL_HOUR:
case SQL_INTERVAL_HOUR_TO_MINUTE:
case SQL_INTERVAL_HOUR_TO_SECOND:
case SQL_INTERVAL_MINUTE:
case SQL_INTERVAL_MINUTE_TO_SECOND:
case SQL_INTERVAL_MONTH:
case SQL_INTERVAL_SECOND:
case SQL_INTERVAL_YEAR:
case SQL_INTERVAL_YEAR_TO_MONTH:
case SQL_LONGVARBINARY:
case SQL_LONGVARCHAR:
case SQL_LONGVARNCHAR:
case SQL_NCHAR:
case SQL_NCLOB:
case SQL_NUMERIC:
case SQL_NVARCHAR:
case SQL_REAL:
case SQL_SMALLINT:
case SQL_TIME:
case SQL_TIMESTAMP:
case SQL_TINYINT:
case SQL_TSI_DAY:
case SQL_TSI_FRAC_SECOND:
case SQL_TSI_HOUR:
case SQL_TSI_MICROSECOND:
case SQL_TSI_MINUTE:
case SQL_TSI_MONTH:
case SQL_TSI_QUARTER:
case SQL_TSI_SECOND:
case SQL_TSI_WEEK:
case SQL_TSI_YEAR:
case SQL_VARBINARY:
case SQL_VARCHAR:
case STATE:
case STATEMENT:
case STRUCTURE:
case STYLE:
case SUBCLASS_ORIGIN:
case SUBSTITUTE:
case TABLE_NAME:
case TEMPORARY:
case TIES:
case TIMESTAMPADD:
case TIMESTAMPDIFF:
case TOP_LEVEL_COUNT:
case TRANSACTION:
case TRANSACTIONS_ACTIVE:
case TRANSACTIONS_COMMITTED:
case TRANSACTIONS_ROLLED_BACK:
case TRANSFORM:
case TRANSFORMS:
case TRIGGER_CATALOG:
case TRIGGER_NAME:
case TRIGGER_SCHEMA:
case TYPE:
case UNBOUNDED:
case UNCOMMITTED:
case UNCONDITIONAL:
case UNDER:
case UNNAMED:
case USAGE:
case USER_DEFINED_TYPE_CATALOG:
case USER_DEFINED_TYPE_CODE:
case USER_DEFINED_TYPE_NAME:
case USER_DEFINED_TYPE_SCHEMA:
case UTF8:
case UTF16:
case UTF32:
case VERSION:
case VIEW:
case WEEK:
case WORK:
case WRAPPER:
case WRITE:
case XML:
case ZONE:
case IF:
case MATERIALIZED:
case STORED:
case VIRTUAL:
case JAR:
case FILE:
case ARCHIVE:
case BRACKET_QUOTED_IDENTIFIER:
case QUOTED_IDENTIFIER:
case BACK_QUOTED_IDENTIFIER:
case IDENTIFIER:
case UNICODE_QUOTED_IDENTIFIER:
e = SimpleIdentifier();
break;
case LPAREN:
jj_consume_token(LPAREN);
e = PatternExpression();
jj_consume_token(RPAREN);
break;
case LBRACE:
jj_consume_token(LBRACE);
s = span();
jj_consume_token(MINUS);
e = PatternExpression();
jj_consume_token(MINUS);
jj_consume_token(RBRACE);
e = SqlStdOperatorTable.PATTERN_EXCLUDE.createCall(s.end(this), e);
break;
case PERMUTE:
jj_consume_token(PERMUTE);
s = span();
jj_consume_token(LPAREN);
e = PatternExpression();
eList = new ArrayList();
eList.add(e);
label_23:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case COMMA:
;
break;
default:
jj_la1[159] = jj_gen;
break label_23;
}
jj_consume_token(COMMA);
e = PatternExpression();
eList.add(e);
}
jj_consume_token(RPAREN);
e = SqlStdOperatorTable.PATTERN_PERMUTE.createCall(
s.end(this), eList);
break;
default:
jj_la1[160] = jj_gen;
jj_consume_token(-1);
throw new ParseException();
}
{if (true) return e;}
throw new Error("Missing return statement in function");
}
final public SqlNodeList SubsetDefinitionCommaList(Span s) throws ParseException {
SqlNode e;
final List eList = new ArrayList();
e = SubsetDefinition();
eList.add(e);
label_24:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case COMMA:
;
break;
default:
jj_la1[161] = jj_gen;
break label_24;
}
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");
}
final public SqlNode SubsetDefinition() throws ParseException {
final SqlNode var;
final SqlNodeList varList;
var = SimpleIdentifier();
jj_consume_token(EQ);
jj_consume_token(LPAREN);
varList = ExpressionCommaList(span(), ExprContext.ACCEPT_NON_QUERY);
jj_consume_token(RPAREN);
{if (true) return SqlStdOperatorTable.EQUALS.createCall(span().end(var), var,
varList);}
throw new Error("Missing return statement in function");
}
final public SqlNodeList PatternDefinitionCommaList(Span s) throws ParseException {
SqlNode e;
final List eList = new ArrayList();
e = PatternDefinition();
eList.add(e);
label_25:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case COMMA:
;
break;
default:
jj_la1[162] = jj_gen;
break label_25;
}
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 SqlNode PatternDefinition() throws ParseException {
final SqlNode var;
final SqlNode e;
var = SimpleIdentifier();
jj_consume_token(AS);
e = Expression(ExprContext.ACCEPT_SUB_QUERY);
{if (true) return SqlStdOperatorTable.AS.createCall(Span.of(var, e).pos(), e, var);}
throw new Error("Missing return statement in function");
}
// ----------------------------------------------------------------------------
// Expressions
/**
* Parses a SQL expression (such as might occur in a WHERE clause) followed by
* the end-of-file symbol.
*/
final public SqlNode SqlExpressionEof() throws ParseException {
SqlNode e;
e = Expression(ExprContext.ACCEPT_SUB_QUERY);
jj_consume_token(0);
{if (true) return e;}
throw new Error("Missing return statement in function");
}
/**
* Parses either a row expression or a query expression without ORDER BY.
*/
final public SqlNode QueryOrExpr(ExprContext exprContext) throws ParseException {
SqlNodeList withList = null;
SqlNode e;
SqlOperator op;
SqlParserPos pos;
SqlParserPos withPos;
List