use of com.alibaba.druid.sql.dialect.oracle.ast.stmt.OracleSelectSubqueryTableSource in project druid by alibaba.
the class OracleSelectParser method parseTableSource.
@Override
public SQLTableSource parseTableSource() {
if (lexer.token() == (Token.LPAREN)) {
lexer.nextToken();
OracleSelectSubqueryTableSource tableSource;
if (lexer.token() == Token.SELECT || lexer.token() == Token.WITH) {
tableSource = new OracleSelectSubqueryTableSource(select());
} else if (lexer.token() == (Token.LPAREN)) {
tableSource = new OracleSelectSubqueryTableSource(select());
} else {
throw new ParserException("TODO :" + lexer.token());
}
accept(Token.RPAREN);
parsePivot((OracleSelectTableSource) tableSource);
return parseTableSourceRest(tableSource);
}
if (lexer.token() == (Token.SELECT)) {
throw new ParserException("TODO");
}
OracleSelectTableReference tableReference = new OracleSelectTableReference();
if (identifierEquals("ONLY")) {
lexer.nextToken();
tableReference.setOnly(true);
accept(Token.LPAREN);
parseTableSourceQueryTableExpr(tableReference);
accept(Token.RPAREN);
} else {
parseTableSourceQueryTableExpr(tableReference);
parsePivot(tableReference);
}
return parseTableSourceRest(tableReference);
}
Aggregations