[SPARK-55341][SQL] Add storage level flag for cached local relations#54118
Closed
pranavdev022 wants to merge 2 commits intoapache:masterfrom
Closed
[SPARK-55341][SQL] Add storage level flag for cached local relations#54118pranavdev022 wants to merge 2 commits intoapache:masterfrom
pranavdev022 wants to merge 2 commits intoapache:masterfrom
Conversation
JIRA Issue Information=== Task SPARK-55341 === This comment was automatically generated by GitHub Actions |
1e88816 to
a73ff6f
Compare
HyukjinKwon
reviewed
Feb 5, 2026
| if (existingBlock == null || existingBlock.id != blockId) { | ||
| val storageLevelStr = session.conf.get( | ||
| SQLConf.ARTIFACT_MANAGER_CACHE_STORAGE_LEVEL) | ||
| val storageLevel = try { |
Member
There was a problem hiding this comment.
Seems like you're not setting storageLevel to level. BTW, I think you don't need to do a try-catch. You can add the validation logic in conf itself with checkValues.
Contributor
Author
There was a problem hiding this comment.
@HyukjinKwon thanks for pointing these out.
I have set level to use StorageLevel and simplified the validation logic using checkValues.
Contributor
|
Merging to master |
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?
This PR adds a feature flag
spark.sql.artifact.cacheStorageLevelto control the storage level used for cached blocks:DISK_ONLYstorage level to reduce memory pressureMEMORY_AND_DISK_SERstorage level (current behavior)This allows users to opt into disk-only storage for cached artifacts when memory is constrained, while maintaining backward compatibility with the default behavior.
Why are the changes needed?
Cached artifact blocks in ArtifactManager currently use
MEMORY_AND_DISK_SERstorage level. In some scenarios with large artifacts, especially large local relations, this can cause memory pressure.Does this PR introduce any user-facing change?
No
How was this patch tested?
Existing tests verify the default behavior
MEMORY_AND_DISK_SERcontinues to work correctly. The flag is internal and defaults toMEMORY_AND_DISK_SER, maintaining current behavior.Was this patch authored or co-authored using generative AI tooling?
No