[fix](Nereids) delete using should support sql without where (#29518)

This commit is contained in:
morrySnow
2024-01-08 15:13:59 +08:00
committed by yiguolei
parent ddaa645a4f
commit 847898bf26
3 changed files with 6 additions and 6 deletions

View File

@ -809,12 +809,12 @@ public class LogicalPlanBuilder extends DorisParserBaseVisitor<Object> {
tableAlias = ctx.tableAlias().getText();
}
if (ctx.USING() == null && ctx.cte() == null && ctx.explain() == null) {
query = withFilter(query, Optional.of(ctx.whereClause()));
query = withFilter(query, Optional.ofNullable(ctx.whereClause()));
return new DeleteFromCommand(tableName, tableAlias, partitionSpec.first, partitionSpec.second, query);
} else {
// convert to insert into select
query = withRelations(query, ctx.relation());
query = withFilter(query, Optional.of(ctx.whereClause()));
query = withFilter(query, Optional.ofNullable(ctx.whereClause()));
Optional<LogicalPlan> cte = Optional.empty();
if (ctx.cte() != null) {
cte = Optional.ofNullable(withCte(query, ctx.cte()));