Skip to content

Commit

Permalink
Revert "[enhance]Added compatibility with mysql alias conflict"
Browse files Browse the repository at this point in the history
This reverts commit 1131d2f.
  • Loading branch information
Toms1999 committed Jul 18, 2024
1 parent 1131d2f commit 3bc745c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 133 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@
import org.apache.doris.nereids.trees.plans.logical.LogicalInlineTable;
import org.apache.doris.nereids.trees.plans.logical.LogicalIntersect;
import org.apache.doris.nereids.trees.plans.logical.LogicalJoin;
import org.apache.doris.nereids.trees.plans.logical.LogicalOlapScan;
import org.apache.doris.nereids.trees.plans.logical.LogicalOneRowRelation;
import org.apache.doris.nereids.trees.plans.logical.LogicalPlan;
import org.apache.doris.nereids.trees.plans.logical.LogicalProject;
Expand Down Expand Up @@ -508,31 +507,6 @@ private LogicalJoin<Plan, Plan> bindJoin(MatchingContext<LogicalJoin<Plan, Plan>
LogicalJoin<Plan, Plan> join = ctx.root;
CascadesContext cascadesContext = ctx.cascadesContext;

Set<String> tableNames = new HashSet<>();
List<Plan> children = join.children();
for (Plan child : children) {
// get alias name
if (child instanceof LogicalSubQueryAlias) {
LogicalSubQueryAlias subQueryAlias = (LogicalSubQueryAlias) child;
String alias = subQueryAlias.getAlias();

if (!tableNames.add(alias)) {
throw new AnalysisException("Not unique table/alias: '" + alias + "'");
}
// get table name
} else if (child instanceof LogicalFilter) {
Plan grandChild = child.children().get(0);
if (grandChild instanceof LogicalOlapScan) {
LogicalOlapScan olapScan = (LogicalOlapScan) grandChild;
String tableName = olapScan.getTable().getName();

if (!tableNames.add(tableName)) {
throw new AnalysisException("Not unique table/alias: '" + tableName + "'");
}
}
}
}

SimpleExprAnalyzer analyzer = buildSimpleExprAnalyzer(
join, cascadesContext, join.children(), true, true);

Expand Down
107 changes: 0 additions & 107 deletions regression-test/suites/nereids_syntax_p0/alias_conflict.groovy

This file was deleted.

0 comments on commit 3bc745c

Please sign in to comment.