diff --git a/fe/fe-core/src/main/java/org/apache/doris/planner/external/FileQueryScanNode.java b/fe/fe-core/src/main/java/org/apache/doris/planner/external/FileQueryScanNode.java index 4cf6ac829aa360..f5021c26080af3 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/planner/external/FileQueryScanNode.java +++ b/fe/fe-core/src/main/java/org/apache/doris/planner/external/FileQueryScanNode.java @@ -326,6 +326,8 @@ public void createScanRangeLocations() throws UserException { HudiScanNode.setHudiParams(rangeDesc, (HudiSplit) fileSplit); } + curLocations.getScanRange().getExtScanRange().getFileScanRange().addToRanges(rangeDesc); + TScanRangeLocation location = new TScanRangeLocation(); Backend selectedBackend; if (enableSqlCache) { // Use consistent hash to assign the same scan range into the same backend among different queries @@ -336,9 +338,6 @@ public void createScanRangeLocations() throws UserException { } else { selectedBackend = backendPolicy.getNextBe(); } - - curLocations.getScanRange().getExtScanRange().getFileScanRange().addToRanges(rangeDesc); - TScanRangeLocation location = new TScanRangeLocation(); location.setBackendId(selectedBackend.getId()); location.setServer(new TNetworkAddress(selectedBackend.getHost(), selectedBackend.getBePort())); curLocations.addToLocations(location);