mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved sql parser.
This commit is contained in:
@@ -79,7 +79,7 @@ public class OdpsCreateTableParser extends SQLCreateTableParser {
|
||||
|
||||
for (;;) {
|
||||
if (lexer.token() != Token.IDENTIFIER) {
|
||||
throw new ParserException("expect identifier");
|
||||
throw new ParserException("expect identifier. " + lexer.info());
|
||||
}
|
||||
|
||||
SQLColumnDefinition column = this.exprParser.parseColumn();
|
||||
@@ -114,7 +114,7 @@ public class OdpsCreateTableParser extends SQLCreateTableParser {
|
||||
|
||||
for (;;) {
|
||||
if (lexer.token() != Token.IDENTIFIER) {
|
||||
throw new ParserException("expect identifier");
|
||||
throw new ParserException("expect identifier. " + lexer.info());
|
||||
}
|
||||
|
||||
SQLColumnDefinition column = this.exprParser.parseColumn();
|
||||
@@ -159,7 +159,7 @@ public class OdpsCreateTableParser extends SQLCreateTableParser {
|
||||
stmt.setBuckets(lexer.integerValue().intValue());
|
||||
lexer.nextToken();
|
||||
} else {
|
||||
throw new ParserException("into buckets must be integer.");
|
||||
throw new ParserException("into buckets must be integer. " + lexer.info());
|
||||
}
|
||||
acceptIdentifier("BUCKETS");
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ public class OdpsLexer extends Lexer {
|
||||
ch = charAt(++pos);
|
||||
break;
|
||||
} else if (ch == EOI) {
|
||||
throw new ParserException("illegal identifier");
|
||||
throw new ParserException("illegal identifier. " + info());
|
||||
}
|
||||
|
||||
bufPos++;
|
||||
@@ -214,7 +214,7 @@ public class OdpsLexer extends Lexer {
|
||||
|
||||
final boolean firstFlag = isFirstIdentifierChar(first);
|
||||
if (!firstFlag) {
|
||||
throw new ParserException("illegal identifier");
|
||||
throw new ParserException("illegal identifier. " + info());
|
||||
}
|
||||
|
||||
mark = pos;
|
||||
|
||||
@@ -122,7 +122,7 @@ public class OdpsStatementParser extends SQLStatementParser {
|
||||
return true;
|
||||
}
|
||||
|
||||
throw new ParserException("TODO " + lexer.token() + " " + lexer.stringVal());
|
||||
throw new ParserException("TODO " + lexer.info());
|
||||
}
|
||||
|
||||
if (identifierEquals("REMOVE")) {
|
||||
@@ -137,7 +137,7 @@ public class OdpsStatementParser extends SQLStatementParser {
|
||||
return true;
|
||||
}
|
||||
|
||||
throw new ParserException("TODO " + lexer.token() + " " + lexer.stringVal());
|
||||
throw new ParserException("TODO " + lexer.info());
|
||||
}
|
||||
|
||||
if (identifierEquals("READ")) {
|
||||
@@ -222,7 +222,7 @@ public class OdpsStatementParser extends SQLStatementParser {
|
||||
expr_condition.setExpr(this.exprParser.expr());
|
||||
return expr_condition;
|
||||
} else {
|
||||
throw new ParserException("TODO " + lexer.token() + " " + lexer.stringVal());
|
||||
throw new ParserException("TODO " + lexer.info());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -378,7 +378,7 @@ public class OdpsStatementParser extends SQLStatementParser {
|
||||
return stmt;
|
||||
}
|
||||
|
||||
throw new ParserException("TODO " + lexer.token() + " " + lexer.stringVal());
|
||||
throw new ParserException("TODO " + lexer.info());
|
||||
}
|
||||
|
||||
public SQLStatement parseSet() {
|
||||
|
||||
Reference in New Issue
Block a user