Skip to content

Commit

Permalink
branch-2.1: [fix](split)Fixed the bug that batch mode split could not…
Browse files Browse the repository at this point in the history
… query data in multiple be scenarios. #46218 (#46227)

Cherry-picked from #46218

Co-authored-by: daidai <[email protected]>
  • Loading branch information
github-actions[bot] and hubgeter authored Dec 31, 2024
1 parent 2f6c13d commit 9593a7b
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,10 @@ public void createScanRangeLocations() throws UserException {
totalFileSize = fileSplit.getLength() * selectedSplitNum;
long maxWaitTime = ConnectContext.get().getSessionVariable().getFetchSplitsMaxWaitTime();
// Not accurate, only used to estimate concurrency.
int numSplitsPerBE = numApproximateSplits() / backendPolicy.numBackends();
// Here, we must take the max of 1, because
// in the case of multiple BEs, `numApproximateSplits() / backendPolicy.numBackends()` may be 0,
// and finally numSplitsPerBE is 0, resulting in no data being queried.
int numSplitsPerBE = Math.max(numApproximateSplits() / backendPolicy.numBackends(), 1);
for (Backend backend : backendPolicy.getBackends()) {
SplitSource splitSource = new SplitSource(backend, splitAssignment, maxWaitTime);
splitSources.add(splitSource);
Expand Down

0 comments on commit 9593a7b

Please sign in to comment.