[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:
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user