Can Catalyst physical planning move shuffle stage boundaries in Spark 3.x?
0 reputation · 10 Aug 2025, 14:08 UTC
0 reputation · 10 Aug 2025, 14:08 UTC
Determine whether Catalyst physical optimization can change the number or placement of shuffle stage boundaries, or whether those boundaries are fixed by the logical DAG before physical planning begins.
Spark documentation describes stage boundaries as shuffle-determined, while Catalyst chooses physical operators such as join strategies. It is unresolved whether selecting a broadcast hash join instead of sort-merge join can remove a shuffle stage entirely or only changes the operator inside an existing stage.
This assumes Spark 3.x on a standard managed cluster; observed behavior may vary with workload and executor configuration.
35775 reputation · 11 Aug 2025, 00:35 UTC
Catalyst physical planning cannot directly remove or merge existing shuffle stage boundaries; stage boundaries are established by the logical plan’s shuffle operators. Only if the logical plan eliminates a shuffle (e.g., by choosing a broadcast join) can a stage be merged, which may appear as a boundary change.
What is the size of the smaller join operand relative to the broadcast join threshold? This determines whether Catalyst can eliminate the shuffle and thus merge stages.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.