refactor sql parser.

This commit is contained in:
wenshao
2017-08-30 16:51:50 +08:00
parent aa260c9ee3
commit 99fe9112b4
75 changed files with 994 additions and 974 deletions
@@ -44,10 +44,10 @@ public class SQLServerExprParser extends SQLExprParser {
static {
String[] strings = { "AVG", "COUNT", "MAX", "MIN", "ROW_NUMBER", "STDDEV", "SUM" };
AGGREGATE_FUNCTIONS_CODES = FnvHash.fnv_64_lower(strings, true);
AGGREGATE_FUNCTIONS_CODES = FnvHash.fnv1a_64_lower(strings, true);
AGGREGATE_FUNCTIONS = new String[AGGREGATE_FUNCTIONS_CODES.length];
for (String str : strings) {
long hash = FnvHash.fnv_64_lower(str);
long hash = FnvHash.fnv1a_64_lower(str);
int index = Arrays.binarySearch(AGGREGATE_FUNCTIONS_CODES, hash);
AGGREGATE_FUNCTIONS[index] = str;
}
@@ -84,16 +84,11 @@ public class SQLServerSchemaStatVisitor extends SchemaStatVisitor implements SQL
@Override
public boolean visit(SQLServerUpdateStatement x) {
setAliasMap();
String ident = x.getTableName().toString();
TableStat stat = getTableStat(ident);
stat.incrementUpdateCount();
Map<String, String> aliasMap = getAliasMap();
aliasMap.put(ident, ident);
accept(x.getItems());
accept(x.getFrom());
accept(x.getWhere());