Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
924060929 committed Jun 6, 2024
1 parent 5e2b4f4 commit 0c71b1f
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,16 @@ public List<AssignedJob> computeAssignedJobs(
int expectInstanceNum = degreeOfParallelism();
List<AssignedJob> biggestParallelChildFragment = getInstancesOfBiggestParallelChildFragment(inputJobs);

int realInstanceNum =
(expectInstanceNum > 0 && expectInstanceNum < biggestParallelChildFragment.size())
int realInstanceNum
= (expectInstanceNum > 0 && expectInstanceNum < biggestParallelChildFragment.size())
? expectInstanceNum
: biggestParallelChildFragment.size();

// When group by cardinality is smaller than number of backend, only some backends always
// process while other has no data to process.
// So we shuffle instances to make different backends handle different queries.
List<Worker> shuffleWorkersInBiggestParallelChildFragment = distinctShuffleWorkers(biggestParallelChildFragment);
List<Worker> shuffleWorkersInBiggestParallelChildFragment
= distinctShuffleWorkers(biggestParallelChildFragment);
Function<Integer, Worker> workerSelector = instanceIndex -> {
int selectIndex = instanceIndex % shuffleWorkersInBiggestParallelChildFragment.size();
return shuffleWorkersInBiggestParallelChildFragment.get(selectIndex);
Expand Down

0 comments on commit 0c71b1f

Please sign in to comment.