[SPARK-55395][SQL] Disable RDD cache in DataFrame.zipWithIndex#54178
Open
zhengruifeng wants to merge 5 commits intoapache:masterfrom
Open
[SPARK-55395][SQL] Disable RDD cache in DataFrame.zipWithIndex#54178zhengruifeng wants to merge 5 commits intoapache:masterfrom
DataFrame.zipWithIndex#54178zhengruifeng wants to merge 5 commits intoapache:masterfrom
Conversation
JIRA Issue Information=== Improvement SPARK-55395 === This comment was automatically generated by GitHub Actions |
b30fe08 to
1afefd0
Compare
Contributor
Author
|
on second thought, let me use a bool parameter |
1afefd0 to
c4e7d72
Compare
zhengruifeng
commented
Feb 7, 2026
| @staticmethod | ||
| def distributed_sequence_id() -> Column: | ||
| return InternalFunction._invoke_internal_function_over_columns("distributed_sequence_id") | ||
| return InternalFunction._invoke_internal_function_over_columns( |
Contributor
Author
There was a problem hiding this comment.
this is only used in PS
zhengruifeng
commented
Feb 7, 2026
| */ | ||
| private[sql] def withSequenceColumn(name: String) = { | ||
| select(Column(DistributedSequenceID()).alias(name), col("*")) | ||
| select(Column(DistributedSequenceID(Literal(true))).alias(name), col("*")) |
Contributor
Author
There was a problem hiding this comment.
this should be also a place for PS on pyspark classic
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?
Disable RDD cache in DataFrame.zipWithIndex
Why are the changes needed?
When
AttachDistributedSequencewas first introduced for Pandas API on Spark in 93cec49, the underlying RDD was alwayslocalCheckpointed to cache to avoid re-computation.Then we hit serious executor memory issue, and in 4279090 we made the storage level configurable and release the cached data after each stage by AQE.
Since we are reusing
AttachDistributedSequenceto implementDataFrame.zipWithIndex, to be more conservative, we'd start with a no-cache version, it will be easy to enable the caching if necessary in the future.Moreover, there is some chance to optimize the no-cache version #54169
This PR disable the RDD cache in
DistributedSequenceIDby default; and in the PS callsites, explicitly setcache=TrueDoes this PR introduce any user-facing change?
No
How was this patch tested?
CI
Was this patch authored or co-authored using generative AI tooling?
No