Skip to content

[SPARK-56455][SQL][TESTS] Add test coverage for maxBroadcastTableSize config enforcement#55313

Open
pratham76 wants to merge 1 commit intoapache:masterfrom
pratham76:test-broadcast
Open

[SPARK-56455][SQL][TESTS] Add test coverage for maxBroadcastTableSize config enforcement#55313
pratham76 wants to merge 1 commit intoapache:masterfrom
pratham76:test-broadcast

Conversation

@pratham76
Copy link
Copy Markdown

What changes were proposed in this pull request?

Currently, there is no validation for enforcement of spark.sql.maxBroadcastTableSize.

This change introduces unit tests that:

  • Verify broadcast joins succeed when under the configured size limit.
  • Verify proper exception is thrown when exceeding the threshold.

Why are the changes needed?

This helps prevent regressions and ensures consistent enforcement of broadcast size limits.

Does this PR introduce any user-facing change?

No

How was this patch tested?

Existing Test Suites -- additional test cases added

Was this patch authored or co-authored using generative AI tooling?

No

@pratham76
Copy link
Copy Markdown
Author

@sunchao @dongjoon-hyun Could you have a look? Thanks!

Copy link
Copy Markdown
Member

@sunchao sunchao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with one nit

val ex = intercept[SparkException] {
joinDF.collect()
}
assert(ex.getMessage.contains("Cannot broadcast"))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this check is probably to board: since we are testing against maxBroadcastTableSize, we can check the error message directly here or the error code _LEGACY_ERROR_TEMP_2249.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @sunchao, have used the approach of using error code to verify here.

@HyukjinKwon HyukjinKwon changed the title [SPARK-56455][SQL] Add test coverage for maxBroadcastTableSize config enforcement [SPARK-56455][SQL][TESTS] Add test coverage for maxBroadcastTableSize config enforcement Apr 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants