Skip to content

Commit

Permalink
Remove invalid check for broadcast partition id
Browse files Browse the repository at this point in the history
Do not use the partition id assigned to the task for broadcast distributions.
Instead all tasks read from the same partition.

Fixes prestodb#4071
  • Loading branch information
dain committed Dec 3, 2015
1 parent 283d5e7 commit 11514ba
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

import static com.facebook.presto.OutputBuffers.BROADCAST_PARTITION_ID;
import static com.facebook.presto.OutputBuffers.INITIAL_EMPTY_OUTPUT_BUFFERS;
import static com.google.common.base.Preconditions.checkArgument;
import static java.util.Objects.requireNonNull;

@ThreadSafe
Expand Down Expand Up @@ -51,8 +50,8 @@ public void addOutputBuffer(TaskId bufferId, int partition)
return;
}

checkArgument(partition == BROADCAST_PARTITION_ID, "Broadcast partition must be %s", BROADCAST_PARTITION_ID);
newOutputBuffers = outputBuffers.withBuffer(bufferId, partition);
// Note: it does not matter which partition id the task is using, in broadcast all tasks read from the same partition
newOutputBuffers = outputBuffers.withBuffer(bufferId, BROADCAST_PARTITION_ID);
if (newOutputBuffers == outputBuffers) {
return;
}
Expand Down

0 comments on commit 11514ba

Please sign in to comment.