Skip to content

Commit

Permalink
Revert "Record all table references in schemaStatVisitor."
Browse files Browse the repository at this point in the history
This reverts commit c83288e.
  • Loading branch information
lingo-xp authored and wenshao committed Jan 13, 2025
1 parent 43e4d15 commit d20eed8
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 63 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,13 @@
import com.alibaba.druid.stat.TableStat.Mode;
import com.alibaba.druid.stat.TableStat.Relationship;
import com.alibaba.druid.util.FnvHash;
import org.apache.commons.lang3.tuple.Pair;

import java.util.*;

public class SchemaStatVisitor extends SQLASTVisitorAdapter {
protected SchemaRepository repository;

protected final List<SQLName> originalTables = new ArrayList<SQLName>();
protected final List<Pair<SQLName, String>> tableReferences = new ArrayList<>();

protected final HashMap<TableStat.Name, TableStat> tableStats = new LinkedHashMap<TableStat.Name, TableStat>();
protected final Map<Long, Column> columns = new LinkedHashMap<Long, Column>();
Expand Down Expand Up @@ -125,10 +123,6 @@ public TableStat getTableStat(String tableName) {
return stat;
}

public List<Pair<SQLName, String>> getTableReferences() {
return tableReferences;
}

public TableStat getTableStat(SQLName tableName) {
String strName;
if (tableName instanceof SQLIdentifierExpr) {
Expand Down Expand Up @@ -1978,11 +1972,6 @@ public TableStat getTableStat(SQLExprTableSource tableSource) {
tableSource.getExpr());
}

protected void recordTableReference(SQLExprTableSource x) {
if (x.getExpr() instanceof SQLName) {
tableReferences.add(Pair.of(((SQLName) x.getExpr()), x.getAlias()));
}
}
protected TableStat getTableStatWithUnwrap(SQLExpr expr) {
SQLExpr identExpr = null;

Expand Down Expand Up @@ -2034,7 +2023,6 @@ public boolean visit(SQLExprTableSource x) {
}

if (isSimpleExprTableSource(x)) {
recordTableReference(x);
TableStat stat = getTableStatWithUnwrap(expr);
if (stat == null) {
return false;
Expand Down

This file was deleted.

0 comments on commit d20eed8

Please sign in to comment.