[fix](Nereids) delete using should support sql without where (#29518)
This commit is contained in:
@ -65,7 +65,7 @@ statement
|
||||
| explain? cte? DELETE FROM tableName=multipartIdentifier
|
||||
partitionSpec? tableAlias
|
||||
(USING relation (COMMA relation)*)?
|
||||
whereClause #delete
|
||||
whereClause? #delete
|
||||
| LOAD LABEL lableName=identifier
|
||||
LEFT_PAREN dataDescs+=dataDesc (COMMA dataDescs+=dataDesc)* RIGHT_PAREN
|
||||
(withRemoteStorageSystem)?
|
||||
|
||||
@ -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()));
|
||||
|
||||
Reference in New Issue
Block a user