mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved odps parser support
This commit is contained in:
@@ -290,7 +290,13 @@ public class OdpsOutputVisitor extends HiveOutputVisitor implements OdpsASTVisit
|
||||
|
||||
@Override
|
||||
public boolean visit(SQLJoinTableSource x) {
|
||||
x.getLeft().accept(this);
|
||||
SQLTableSource left = x.getLeft();
|
||||
left.accept(this);
|
||||
|
||||
if (left.hasAfterComment() && isPrettyFormat()) {
|
||||
println();
|
||||
printlnComment(left.getAfterCommentsDirect());
|
||||
}
|
||||
|
||||
if (x.getJoinType() == JoinType.COMMA) {
|
||||
print(',');
|
||||
|
||||
@@ -3032,6 +3032,10 @@ public class SQLExprParser extends SQLParser {
|
||||
public SQLExpr orRest(SQLExpr expr) {
|
||||
for (;;) {
|
||||
if (lexer.token == Token.OR) {
|
||||
if (lexer.isKeepComments() && lexer.hasComment()) {
|
||||
expr.addAfterComment(lexer.readAndResetComments());
|
||||
}
|
||||
|
||||
lexer.nextToken();
|
||||
SQLExpr rightExp = xor();
|
||||
|
||||
|
||||
@@ -1132,6 +1132,12 @@ public class SQLSelectParser extends SQLParser {
|
||||
}
|
||||
|
||||
public SQLTableSource parseTableSourceRest(SQLTableSource tableSource) {
|
||||
if (lexer.hasComment()
|
||||
&& lexer.isKeepComments()
|
||||
&& !(tableSource instanceof SQLSubqueryTableSource)) {
|
||||
tableSource.addAfterComment(lexer.readAndResetComments());
|
||||
}
|
||||
|
||||
if (tableSource.getAlias() == null || tableSource.getAlias().length() == 0) {
|
||||
Token token = lexer.token;
|
||||
long hash;
|
||||
|
||||
Reference in New Issue
Block a user