[SPARK-51559][SQL] Make max broadcast table size configurable#50327
Closed
sunchao wants to merge 2 commits intoapache:masterfrom
Closed
[SPARK-51559][SQL] Make max broadcast table size configurable#50327sunchao wants to merge 2 commits intoapache:masterfrom
sunchao wants to merge 2 commits intoapache:masterfrom
Conversation
Member
Author
|
|
||
| val MAX_BROADCAST_TABLE_SIZE = buildConf("spark.sql.maxBroadcastTableSize") | ||
| .doc("The maximum table size that can be broadcast in broadcast joins.") | ||
| .version("4.0.0") |
dongjoon-hyun
approved these changes
Mar 19, 2025
Member
dongjoon-hyun
left a comment
There was a problem hiding this comment.
+1, LGTM for Apache Spark 4.1.0.
You know that you can backport this Apache Spark 4.1.0 commit to the internal fork. :)
viirya
reviewed
Mar 19, 2025
| .createWithDefaultString(s"${5 * 60}") | ||
|
|
||
| val MAX_BROADCAST_TABLE_SIZE = buildConf("spark.sql.maxBroadcastTableSize") | ||
| .doc("The maximum table size that can be broadcast in broadcast joins.") |
Member
There was a problem hiding this comment.
Suggested change
| .doc("The maximum table size that can be broadcast in broadcast joins.") | |
| .doc("The maximum table size in bytes that can be broadcast in broadcast joins.") |
viirya
approved these changes
Mar 19, 2025
Member
Author
Haha our internal folk already has the commit :) |
Member
Author
|
Thanks! merged to master. |
Contributor
|
late LGTM |
zhouyuan
pushed a commit
to apache/gluten
that referenced
this pull request
Apr 18, 2025
Port apache/spark#50327 to make max broadcast table size configurable. Also, remove our hardcoded ones and make some custom spark build happy
Contributor
|
@sunchao @dongjoon-hyun Is it possible that we could backport this change for spark 3.5 and 4.0 as well? This also helps when broadcast hints are used to optimize queries involving slightly larger tables (> 8GB). Do let me know if i can contribute. Thanks! |
pratham76
pushed a commit
to pratham76/spark
that referenced
this pull request
Mar 1, 2026
pratham76
pushed a commit
to pratham76/spark
that referenced
this pull request
Mar 1, 2026
pratham76
pushed a commit
to pratham76/spark
that referenced
this pull request
Mar 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Currently the maximum size for a table to be broadcast in
BroadcastExchangeExecis hard-coded to 8GB, and it seems there is no particular reason why this value was picked initially. In certain scenarios, we may want broadcast hash join to be triggered even with larger table sizes, since otherwise it will fallback to expensive shuffle join.Why are the changes needed?
This PR introduces a new configuration:
spark.sql.maxBroadcastTableSize, which by default still uses 8GB, so no behavior change expected. This would allow users to update the config when necessary to be more flexible.Does this PR introduce any user-facing change?
No behavior change. Only a new config is added.
How was this patch tested?
We tested out this internally and it seems to be working well.
Was this patch authored or co-authored using generative AI tooling?
No