Skip to content

Commit

Permalink
Remove useless TablesContext.tableNameAliasMap
Browse files Browse the repository at this point in the history
  • Loading branch information
terrymanu committed Nov 6, 2024
1 parent a967dfb commit e3c551d
Showing 1 changed file with 0 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import org.apache.shardingsphere.sql.parser.statement.core.segment.generic.table.SimpleTableSegment;
import org.apache.shardingsphere.sql.parser.statement.core.segment.generic.table.SubqueryTableSegment;
import org.apache.shardingsphere.sql.parser.statement.core.segment.generic.table.TableSegment;
import org.apache.shardingsphere.sql.parser.statement.core.value.identifier.IdentifierValue;

import java.util.Collection;
import java.util.Collections;
Expand Down Expand Up @@ -67,8 +66,6 @@ public final class TablesContext {
@Getter(AccessLevel.NONE)
private final Map<String, Collection<SubqueryTableContext>> subqueryTables = new HashMap<>();

private final Map<String, IdentifierValue> tableNameAliasMap = new HashMap<>();

public TablesContext(final SimpleTableSegment table, final DatabaseType databaseType, final String currentDatabaseName) {
this(null == table ? Collections.emptyList() : Collections.singletonList(table), databaseType, currentDatabaseName);
}
Expand All @@ -91,7 +88,6 @@ public TablesContext(final Collection<? extends TableSegment> tables, final Map<
// TODO use sql binder result when statement which contains tables support bind logic
simpleTableSegment.getOwner().ifPresent(optional -> schemaNames.add(optional.getIdentifier().getValue()));
databaseNames.add(findDatabaseName(simpleTableSegment, databaseType).orElse(currentDatabaseName));
tableNameAliasMap.put(simpleTableSegment.getTableName().getIdentifier().getValue().toLowerCase(), each.getAlias().orElse(simpleTableSegment.getTableName().getIdentifier()));
}
if (each instanceof SubqueryTableSegment) {
subqueryTables.putAll(createSubqueryTables(subqueryContexts, (SubqueryTableSegment) each));
Expand Down

0 comments on commit e3c551d

Please sign in to comment.