@Override
public Visitable visit(Visitable node) throws StandardException {
if (node instanceof FromTable) {
TableBinding tableBinding = (TableBinding)((FromTable)node).getUserData();
if (tableBinding != null) {
Columnar table = tableBinding.getTable();
if (!references.containsKey(table.getName())) {
references.put(table.getName(), new HashSet<String>());
}
}
}
else if (node instanceof ColumnReference) {
ColumnBinding columnBinding = (ColumnBinding)((ColumnReference)node).getUserData();
if (columnBinding != null) {
Column column = columnBinding.getColumn();
if (column != null) {
Columnar table = column.getColumnar();
Collection<String> entry = references.get(table.getName());
if (entry == null) {
entry = new HashSet<>();
references.put(table.getName(), entry);
}
entry.add(column.getName());
}
}
}