Skip to content

Commit f2eb400

Browse files
authored
[opt](coordinator) All Command can use NereidsCoordinator (#58360)
All Command can use NereidsCoordinator, e.g. UpdateCommand
1 parent 01ad41b commit f2eb400

File tree

2 files changed

+39
-11
lines changed

2 files changed

+39
-11
lines changed

fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,13 @@
2929
import org.apache.doris.common.util.TimeUtils;
3030
import org.apache.doris.common.util.Util;
3131
import org.apache.doris.nereids.StatementContext;
32-
import org.apache.doris.nereids.analyzer.UnboundResultSink;
3332
import org.apache.doris.nereids.glue.LogicalPlanAdapter;
3433
import org.apache.doris.nereids.metrics.Event;
3534
import org.apache.doris.nereids.metrics.EventSwitchParser;
3635
import org.apache.doris.nereids.parser.Dialect;
3736
import org.apache.doris.nereids.rules.RuleType;
3837
import org.apache.doris.nereids.rules.exploration.mv.PreMaterializedViewRewriter.PreRewriteStrategy;
3938
import org.apache.doris.nereids.rules.expression.ExpressionRuleType;
40-
import org.apache.doris.nereids.trees.plans.commands.insert.InsertIntoTableCommand;
41-
import org.apache.doris.nereids.trees.plans.logical.LogicalFileSink;
42-
import org.apache.doris.nereids.trees.plans.logical.LogicalPlan;
4339
import org.apache.doris.planner.GroupCommitBlockSink;
4440
import org.apache.doris.qe.VariableMgr.VarAttr;
4541
import org.apache.doris.thrift.TGroupCommitMode;
@@ -4431,13 +4427,6 @@ public static boolean canUseNereidsDistributePlanner() {
44314427
if (!(parsedStatement instanceof LogicalPlanAdapter)) {
44324428
return false;
44334429
}
4434-
LogicalPlan logicalPlan = ((LogicalPlanAdapter) parsedStatement).getLogicalPlan();
4435-
// TODO: support other sink
4436-
if (!(logicalPlan instanceof UnboundResultSink
4437-
|| logicalPlan instanceof LogicalFileSink
4438-
|| logicalPlan instanceof InsertIntoTableCommand)) {
4439-
return false;
4440-
}
44414430
}
44424431
return sessionVariable.enableNereidsDistributePlanner;
44434432
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
18+
suite('update_use_nereids_coordinator') {
19+
multi_sql """
20+
set enable_nereids_distribute_planner=true;
21+
set enable_sql_cache=false;
22+
drop table if exists update_tbl;
23+
create table if not exists update_tbl(
24+
id int,
25+
value int
26+
)
27+
unique key(id)
28+
distributed by hash(id)
29+
properties('replication_num'='1');
30+
insert into update_tbl values(1, 1);
31+
"""
32+
33+
sql "update update_tbl set value=2 where id =1"
34+
35+
test {
36+
sql "select * from update_tbl"
37+
result([[1, 2]])
38+
}
39+
}

0 commit comments

Comments
 (0)