[SPARK-55720][SS] Deprecate MapPartitions in Streaming Real-Time Mode#54523
Open
eason-yuchen-liu wants to merge 2 commits intoapache:masterfrom
Open
[SPARK-55720][SS] Deprecate MapPartitions in Streaming Real-Time Mode#54523eason-yuchen-liu wants to merge 2 commits intoapache:masterfrom
eason-yuchen-liu wants to merge 2 commits intoapache:masterfrom
Conversation
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 proposes remove operator MapPartitions from the allowlist of Streaming Real-Time Mode. Users are encouraged to use Map + Filter + Explode instead.
Why are the changes needed?
MapPartitionstakes in the iterator of the entire input, and produce the iterator of the entire output. Although giving users the full flexibility, these APIs are very easy to misuse in Streaming Real-Time Mode, where the streamlined behavior of an operator is required. Streamlining means no prefetching or buffering that when the operator consumes one input, it outputs all the results one by one. Users can easily violate the streamline requirement by calling input.hasNext twice or input.toSeq right now. Also, this operator makes potential future features difficult, for example Control Message Propagation.Does this PR introduce any user-facing change?
Yes. Using
MapPartitionsin RTM now results inSTREAMING_REAL_TIME_MODE.OPERATOR_OR_SINK_NOT_IN_ALLOWLISTexception. This is different from the behavior in Spark 4.1, where RTM is first released.How was this patch tested?
Unit tests.
Was this patch authored or co-authored using generative AI tooling?
No.