Exclude broadcast exchanges from PushRemoteExchangeThroughAssignUniqueId
@@ -27,6 +27,7 @@ import java.util.List;
import static com.facebook.presto.matching.Capture.newCapture;
import static com.facebook.presto.sql.planner.plan.ExchangeNode.Scope.REMOTE;
+import static com.facebook.presto.sql.planner.plan.ExchangeNode.Type.REPLICATE;
import static com.facebook.presto.sql.planner.plan.Patterns.assignUniqueId;
import static com.facebook.presto.sql.planner.plan.Patterns.exchange;
import static com.facebook.presto.sql.planner.plan.Patterns.source;
@@ -44,6 +45,7 @@ public final class PushRemoteExchangeThroughAssignUniqueId
private static final Capture<AssignUniqueId> ASSIGN_UNIQUE_ID = newCapture();
private static final Pattern<ExchangeNode> PATTERN = exchange()
.matching(exchange -> exchange.getScope() == REMOTE)
+ .matching(exchange -> exchange.getType() != REPLICATE)
.with(source().matching(assignUniqueId().capturedAs(ASSIGN_UNIQUE_ID)));
@Override
