branch-2.1: [fix](Nereids) insert into with cte cannot be explained (#46384) (#46501)

pick from master #46384
This commit is contained in:
morrySnow
2025-01-07 13:44:32 +08:00
committed by GitHub
parent 52455ed6d5
commit abbf75e9fe
2 changed files with 7 additions and 1 deletions

View File

@ -321,7 +321,11 @@ public class InsertIntoTableCommand extends Command implements ForwardWithSync,
@Override
public Plan getExplainPlan(ConnectContext ctx) {
return InsertUtils.getPlanForExplain(ctx, this.logicalQuery);
Plan plan = InsertUtils.getPlanForExplain(ctx, this.logicalQuery);
if (cte.isPresent()) {
plan = cte.get().withChildren(plan);
}
return plan;
}
@Override