mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved SchemaStatVisitor, support aggregateFunctions
This commit is contained in:
@@ -136,6 +136,7 @@ public class SchemaStatVisitor extends SQLASTVisitorAdapter {
|
||||
protected final Set<Relationship> relationships = new LinkedHashSet<Relationship>();
|
||||
protected final List<Column> orderByColumns = new ArrayList<Column>();
|
||||
protected final Set<Column> groupByColumns = new LinkedHashSet<Column>();
|
||||
protected final List<SQLAggregateExpr> aggregateFunctions = new ArrayList<SQLAggregateExpr>();
|
||||
|
||||
protected final Map<String, SQLObject> subQueryMap = new LinkedHashMap<String, SQLObject>();
|
||||
|
||||
@@ -400,6 +401,10 @@ public class SchemaStatVisitor extends SQLASTVisitorAdapter {
|
||||
public List<Condition> getConditions() {
|
||||
return conditions;
|
||||
}
|
||||
|
||||
public List<SQLAggregateExpr> getAggregateFunctions() {
|
||||
return aggregateFunctions;
|
||||
}
|
||||
|
||||
public boolean visit(SQLBinaryOpExpr x) {
|
||||
x.getLeft().setParent(x);
|
||||
@@ -1176,6 +1181,8 @@ public class SchemaStatVisitor extends SQLASTVisitorAdapter {
|
||||
}
|
||||
|
||||
public boolean visit(SQLAggregateExpr x) {
|
||||
this.aggregateFunctions.add(x);
|
||||
|
||||
accept(x.getArguments());
|
||||
accept(x.getWithinGroup());
|
||||
accept(x.getOver());
|
||||
|
||||
Reference in New Issue
Block a user