Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -720,12 +720,13 @@ public boolean shouldDisableSharedScan(ConnectContext context) {
|| getShouldColoScan();
}

public boolean ignoreStorageDataDistribution(ConnectContext context) {
public boolean ignoreStorageDataDistribution(ConnectContext context, int numBackends) {
return context != null
&& context.getSessionVariable().isIgnoreStorageDataDistribution()
&& context.getSessionVariable().getEnablePipelineXEngine()
&& !fragment.isHasNullAwareLeftAntiJoin()
&& getScanRangeNum() < ConnectContext.get().getSessionVariable().getParallelExecInstanceNum();
&& getScanRangeNum()
< ConnectContext.get().getSessionVariable().getParallelExecInstanceNum() * numBackends;
}

public int getScanRangeNum() {
Expand Down
18 changes: 10 additions & 8 deletions fe/fe-core/src/main/java/org/apache/doris/qe/Coordinator.java
Original file line number Diff line number Diff line change
Expand Up @@ -2039,15 +2039,16 @@ private void computeFragmentHosts() throws Exception {

/**
* Ignore storage data distribution iff:
* 1. Current fragment is not forced to use data distribution.
* 2. `parallelExecInstanceNum` is larger than scan ranges.
* 3. Use Nereids planner.
* 1. `parallelExecInstanceNum * numBackends` is larger than scan ranges.
* 2. Use Nereids planner.
*/
boolean sharedScan = true;
int expectedInstanceNum = Math.min(parallelExecInstanceNum,
leftMostNode.getNumInstances());
boolean ignoreStorageDataDistribution = scanNodes.stream()
.allMatch(scanNode -> scanNode.ignoreStorageDataDistribution(context)) && useNereids;
.allMatch(scanNode -> scanNode.ignoreStorageDataDistribution(context,
fragmentExecParamsMap.get(scanNode.getFragment().getFragmentId())
.scanRangeAssignment.size())) && useNereids;
if (node.isPresent() && (!node.get().shouldDisableSharedScan(context)
|| ignoreStorageDataDistribution)) {
expectedInstanceNum = Math.max(expectedInstanceNum, 1);
Expand Down Expand Up @@ -2973,12 +2974,13 @@ private void assignScanRanges(PlanFragmentId fragmentId, int parallelExecInstanc

/**
* Ignore storage data distribution iff:
* 1. Current fragment is not forced to use data distribution.
* 2. `parallelExecInstanceNum` is larger than scan ranges.
* 3. Use Nereids planner.
* 1. `parallelExecInstanceNum * numBackends` is larger than scan ranges.
* 2. Use Nereids planner.
*/
boolean ignoreStorageDataDistribution = scanNodes.stream()
.allMatch(node -> node.ignoreStorageDataDistribution(context))
.allMatch(node -> node.ignoreStorageDataDistribution(context,
fragmentExecParamsMap.get(node.getFragment().getFragmentId())
.scanRangeAssignment.size()))
&& addressToScanRanges.entrySet().stream().allMatch(addressScanRange -> {
return addressScanRange.getValue().size() < parallelExecInstanceNum;
}) && useNereids;
Expand Down