SchemaStatVisitor support stat functions.

This commit is contained in:
wenshao
2016-09-12 02:26:58 +08:00
parent 67e425c1ee
commit c73573ac8c
3 changed files with 39 additions and 5 deletions
@@ -326,11 +326,6 @@ public class OracleSchemaStatVisitor extends SchemaStatVisitor implements Oracle
return super.visit(x);
}
public boolean visit(SQLMethodInvokeExpr x) {
accept(x.getParameters());
return false;
}
public boolean visit(SQLIdentifierExpr x) {
if ("ROWNUM".equalsIgnoreCase(x.getName())) {
return false;
@@ -137,6 +137,7 @@ public class SchemaStatVisitor extends SQLASTVisitorAdapter {
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 List<SQLMethodInvokeExpr> functions = new ArrayList<SQLMethodInvokeExpr>(2);
protected final Map<String, SQLObject> subQueryMap = new LinkedHashMap<String, SQLObject>();
@@ -1191,6 +1192,8 @@ public class SchemaStatVisitor extends SQLASTVisitorAdapter {
}
public boolean visit(SQLMethodInvokeExpr x) {
this.functions.add(x);
accept(x.getParameters());
return false;
}
@@ -1752,4 +1755,7 @@ public class SchemaStatVisitor extends SQLASTVisitorAdapter {
return false;
}
public List<SQLMethodInvokeExpr> getFunctions() {
return this.functions;
}
}