[fix](Nereids) join order is not right after sql parsing (#28721)

for sql
```
t1, t2 join t3
```

we should generate plan like:
```
t1 join (t2 join t3)
```

but we generate:
```
(t1 join t2) join t3
```
to follow legancy planner.
This commit is contained in:
morrySnow
2023-12-21 20:31:40 +08:00
committed by GitHub
parent e74ff95087
commit e51e94fdec
5 changed files with 572 additions and 29 deletions

View File

@ -2808,7 +2808,7 @@ public class LogicalPlanBuilder extends DorisParserBaseVisitor<Object> {
LogicalPlan left = inputPlan;
for (RelationContext relation : relations) {
// build left deep join tree
LogicalPlan right = visitRelation(relation);
LogicalPlan right = withJoinRelations(visitRelation(relation), relation);
left = (left == null) ? right :
new LogicalJoin<>(
JoinType.CROSS_JOIN,
@ -2818,7 +2818,6 @@ public class LogicalPlanBuilder extends DorisParserBaseVisitor<Object> {
Optional.empty(),
left,
right);
left = withJoinRelations(left, relation);
// TODO: pivot and lateral view
}
return left;