sql parser support drds ddl, for issue #2433

This commit is contained in:
wenshao
2018-04-01 19:55:24 +08:00
parent 3df15cbaed
commit 8f63d50301
13 changed files with 285 additions and 141 deletions
@@ -5083,7 +5083,7 @@ public class SQLASTOutputVisitor extends SQLASTVisitorAdapter implements Paramet
@Override
public boolean visit(SQLPartitionByRange x) {
print0(ucase ? "PARTITION BY RANGE" : "partition by range");
print0(ucase ? "RANGE" : "range");
if (x.getColumns().size() == 1) {
print0(" (");
x.getColumns().get(0).accept(this);
@@ -5125,7 +5125,7 @@ public class SQLASTOutputVisitor extends SQLASTVisitorAdapter implements Paramet
@Override
public boolean visit(SQLPartitionByList x) {
print0(ucase ? "PARTITION BY LIST " : "partition by list ");
print0(ucase ? "LIST " : "list ");
if (x.getColumns().size() == 1) {
print('(');
x.getColumns().get(0).accept(this);
@@ -5145,9 +5145,9 @@ public class SQLASTOutputVisitor extends SQLASTVisitorAdapter implements Paramet
@Override
public boolean visit(SQLPartitionByHash x) {
if (x.isLinear()) {
print0(ucase ? "PARTITION BY LINEAR HASH " : "partition by linear hash ");
print0(ucase ? "LINEAR HASH " : "linear hash ");
} else {
print0(ucase ? "PARTITION BY HASH " : "partition by hash ");
print0(ucase ? "HASH " : "hash ");
}
if (x.isKey()) {
@@ -5939,6 +5939,7 @@ public class SQLASTOutputVisitor extends SQLASTVisitorAdapter implements Paramet
SQLPartitionBy partitionBy = x.getPartitionBy();
if (partitionBy != null) {
println();
print0(ucase ? "PARTITION BY " : "partition by ");
partitionBy.accept(this);
}
@@ -1158,11 +1158,10 @@ public class SchemaStatVisitor extends SQLASTVisitorAdapter {
}
}
} else if (tableSource instanceof SQLWithSubqueryClause.Entry
|| tableSource instanceof SQLSubqueryTableSource) {
return false;
} else if (tableSource instanceof SQLUnionQueryTableSource) {
return false;
} else if (tableSource instanceof SQLLateralViewTableSource) {
|| tableSource instanceof SQLSubqueryTableSource
|| tableSource instanceof SQLUnionQueryTableSource
|| tableSource instanceof SQLLateralViewTableSource
|| tableSource instanceof SQLValuesTableSource) {
return false;
} else {
if (x.getResolvedProcudure() != null) {