[fix](Nereids) npe when delete with cte and without using (#39379) (#39441)

pick from master #39379
This commit is contained in:
morrySnow
2024-08-16 13:56:24 +08:00
committed by GitHub
parent eea3676791
commit ec0e413317
2 changed files with 6 additions and 1 deletions

View File

@ -931,7 +931,9 @@ public class LogicalPlanBuilder extends DorisParserBaseVisitor<Object> {
partitionSpec.second, query);
} else {
// convert to insert into select
query = withRelations(query, ctx.relations().relation());
if (ctx.USING() != null) {
query = withRelations(query, ctx.relations().relation());
}
query = withFilter(query, Optional.ofNullable(ctx.whereClause()));
Optional<LogicalPlan> cte = Optional.empty();
if (ctx.cte() != null) {