mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved odps sql parser.
This commit is contained in:
@@ -224,6 +224,14 @@ public class OdpsLexer extends Lexer {
|
||||
ch = charAt(++pos);
|
||||
|
||||
if (!isIdentifierChar(ch)) {
|
||||
if (ch == '{' && charAt(pos - 1) == '$') {
|
||||
int endIndex = this.text.indexOf('}', pos);
|
||||
if (endIndex != -1) {
|
||||
bufPos += (endIndex - pos + 1);
|
||||
pos = endIndex;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -350,7 +358,7 @@ public class OdpsLexer extends Lexer {
|
||||
|
||||
super.scanVariable();
|
||||
}
|
||||
|
||||
|
||||
protected final void scanString() {
|
||||
scanString2();
|
||||
}
|
||||
|
||||
@@ -141,8 +141,13 @@ public class OdpsStatementParser extends SQLStatementParser {
|
||||
}
|
||||
|
||||
if (identifierEquals("READ")) {
|
||||
lexer.nextToken();
|
||||
OdpsReadStatement stmt = new OdpsReadStatement();
|
||||
|
||||
if (lexer.hasComment() && lexer.isKeepComments()) {
|
||||
stmt.addBeforeComment(lexer.readAndResetComments());
|
||||
}
|
||||
lexer.nextToken();
|
||||
|
||||
stmt.setTable(this.exprParser.name());
|
||||
|
||||
if (lexer.token() == Token.LPAREN) {
|
||||
|
||||
Reference in New Issue
Block a user