mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved sql paser for aliyun analyticdb.
This commit is contained in:
@@ -370,6 +370,13 @@ public class SQLStatementParser extends SQLParser {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (lexer.identifierEquals("DUMP")) {
|
||||
SQLStatement stmt = parseDump();
|
||||
statementList.add(stmt);
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (lexer.identifierEquals(FnvHash.Constants.COMMIT)) {
|
||||
SQLStatement stmt = parseCommit();
|
||||
|
||||
@@ -427,6 +434,26 @@ public class SQLStatementParser extends SQLParser {
|
||||
}
|
||||
}
|
||||
|
||||
public SQLStatement parseDump() {
|
||||
SQLDumpStatement stmt = new SQLDumpStatement();
|
||||
acceptIdentifier("DUMP");
|
||||
acceptIdentifier("DATA");
|
||||
|
||||
if (lexer.identifierEquals(FnvHash.Constants.OVERWRITE)) {
|
||||
lexer.nextToken();
|
||||
stmt.setOverwrite(true);
|
||||
}
|
||||
|
||||
if (lexer.token == Token.INTO) {
|
||||
lexer.nextToken();
|
||||
stmt.setInto(this.exprParser.expr());
|
||||
}
|
||||
|
||||
SQLSelect select = createSQLSelectParser().select();
|
||||
stmt.setSelect(select);
|
||||
return stmt;
|
||||
}
|
||||
|
||||
|
||||
public SQLStatement parseDrop() {
|
||||
List<String> beforeComments = null;
|
||||
|
||||
Reference in New Issue
Block a user