fix bug in or expansion (#34851)
This commit is contained in:
@ -107,7 +107,7 @@ public class OrExpansion extends DefaultPlanRewriter<OrExpandsionContext> implem
|
||||
@Override
|
||||
public Plan visitLogicalCTEAnchor(
|
||||
LogicalCTEAnchor<? extends Plan, ? extends Plan> anchor, OrExpandsionContext ctx) {
|
||||
Plan child1 = this.visit(anchor.child(0), ctx);
|
||||
Plan child1 = anchor.child(0).accept(this, ctx);
|
||||
// Consumer's CTE must be child of the cteAnchor in this case:
|
||||
// anchor
|
||||
// +-producer1
|
||||
@ -121,7 +121,7 @@ public class OrExpansion extends DefaultPlanRewriter<OrExpandsionContext> implem
|
||||
// +-consumer2 join consumer3
|
||||
OrExpandsionContext consumerContext =
|
||||
new OrExpandsionContext(ctx.statementContext, ctx.cascadesContext);
|
||||
Plan child2 = this.visit(anchor.child(1), consumerContext);
|
||||
Plan child2 = anchor.child(1).accept(this, consumerContext);
|
||||
for (int i = consumerContext.cteProducerList.size() - 1; i >= 0; i--) {
|
||||
LogicalCTEProducer<? extends Plan> producer = consumerContext.cteProducerList.get(i);
|
||||
child2 = new LogicalCTEAnchor<>(producer.getCteId(), producer, child2);
|
||||
@ -131,7 +131,7 @@ public class OrExpansion extends DefaultPlanRewriter<OrExpandsionContext> implem
|
||||
|
||||
@Override
|
||||
public Plan visitLogicalJoin(LogicalJoin<? extends Plan, ? extends Plan> join, OrExpandsionContext ctx) {
|
||||
join = (LogicalJoin<? extends Plan, ? extends Plan>) this.visit(join, ctx);
|
||||
join = (LogicalJoin<? extends Plan, ? extends Plan>) join.accept(this, ctx);
|
||||
if (join.isMarkJoin() || !JoinUtils.shouldNestedLoopJoin(join)) {
|
||||
return join;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user