performance - Spark groups broadcast hash join in a single task - Stack Overflow

admin2025-04-17  0

We have a job in spark (databricks) that we are joining ~60 tables.

The job starts by joining the main table with some others tables with SortMergeJoin. This is working fine.

The last step of the query is to join around 20 very small tables and in the execution plan its doing a BroadcastHashjoin with the small tables as expected.

As far as we understood here the problem is that its grouping all 20 broadcasthashjoins into a single task, the operation is very slow and we are heartbeats timeouts probably due to OOM probably.

We were expecting Spark to start with the first table perform the broadcasthashjoin then the second table perform the broadcasthashjoin and so on... and not group all broadcasthashjoins into a single task and we have this performance issue.

One solution I can think is to cache the dataframe after each join without being sure if its going to work 100%.

Is this behavior to group all broadcasthashjoins in a single task expected and due to the Whole-stage code ?

Do you have any other solution to suggest ?

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1744884969a272481.html

最新回复(0)