diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/distribute/worker/job/UnassignedGatherJob.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/distribute/worker/job/UnassignedGatherJob.java index 1789eae644852f..9562ef72f664e1 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/distribute/worker/job/UnassignedGatherJob.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/distribute/worker/job/UnassignedGatherJob.java @@ -22,6 +22,7 @@ import org.apache.doris.nereids.trees.plans.distribute.worker.DistributedPlanWorker; import org.apache.doris.planner.ExchangeNode; import org.apache.doris.planner.PlanFragment; +import org.apache.doris.planner.PlanNode; import org.apache.doris.qe.ConnectContext; import com.google.common.collect.ImmutableList; @@ -77,6 +78,9 @@ selectedWorker, new DefaultScanSource(ImmutableMap.of()) } protected int degreeOfParallelism() { + if (fragment.getPlanRoot().anyMatch(p -> ((PlanNode) p).isSerialOperator())) { + return 1; + } return useLocalShuffleToAddParallel ? fragment.getParallelExecNum() : 1; } } diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/distribute/worker/job/UnassignedShuffleJob.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/distribute/worker/job/UnassignedShuffleJob.java index 6513c2b9c41a6e..694981e52dc636 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/distribute/worker/job/UnassignedShuffleJob.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/distribute/worker/job/UnassignedShuffleJob.java @@ -89,6 +89,10 @@ protected int degreeOfParallelism() { expectInstanceNum = ConnectContext.get().getSessionVariable().getExchangeInstanceParallel(); } + if (fragment.getPlanRoot().anyMatch(p -> ((PlanNode) p).isSerialOperator())) { + return 1; + } + // TODO: check nested loop join do right outer / semi / anti join return expectInstanceNum; }