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:
@@ -6579,6 +6579,32 @@ public class SQLASTOutputVisitor extends SQLASTVisitorAdapter implements Paramet
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(SQLDumpStatement x) {
|
||||
List<SQLCommentHint> headHints = x.getHeadHintsDirect();
|
||||
if (headHints != null) {
|
||||
for (SQLCommentHint hint : headHints) {
|
||||
hint.accept(this);
|
||||
println();
|
||||
}
|
||||
}
|
||||
|
||||
print0(ucase ? "DUMP DATA " : "dump data ");
|
||||
|
||||
|
||||
if (x.isOverwrite()) {
|
||||
print0(ucase ? "OVERWRITE " : "overwrite ");
|
||||
}
|
||||
|
||||
SQLExprTableSource into = x.getInto();
|
||||
if (into != null) {
|
||||
into.accept(this);
|
||||
}
|
||||
|
||||
x.getSelect().accept(this);
|
||||
return false;
|
||||
}
|
||||
|
||||
public void print(float value) {
|
||||
if (this.appender == null) {
|
||||
return;
|
||||
|
||||
@@ -842,4 +842,7 @@ public interface SQLASTVisitor {
|
||||
boolean visit(SQLWindow x);
|
||||
void endVisit(SQLWindow x);
|
||||
|
||||
boolean visit(SQLDumpStatement x);
|
||||
void endVisit(SQLDumpStatement x);
|
||||
|
||||
}
|
||||
|
||||
@@ -1990,7 +1990,6 @@ public class SQLASTVisitorAdapter implements SQLASTVisitor {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean visit(SQLWindow x) {
|
||||
return true;
|
||||
@@ -2000,6 +1999,14 @@ public class SQLASTVisitorAdapter implements SQLASTVisitor {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean visit(SQLDumpStatement x) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public void endVisit(SQLDumpStatement x) {
|
||||
|
||||
}
|
||||
|
||||
public final boolean isEnabled(VisitorFeature feature) {
|
||||
return VisitorFeature.isEnabled(this.features, feature);
|
||||
|
||||
@@ -2515,4 +2515,23 @@ public class SchemaStatVisitor extends SQLASTVisitorAdapter {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean visit(SQLDumpStatement x) {
|
||||
if (repository != null
|
||||
&& x.getParent() == null) {
|
||||
repository.resolve(x);
|
||||
}
|
||||
|
||||
final SQLExprTableSource into = x.getInto();
|
||||
if (into != null) {
|
||||
into.accept(this);
|
||||
}
|
||||
|
||||
final SQLSelect select = x.getSelect();
|
||||
if (select != null) {
|
||||
select.accept(this);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user