[SPARK-53784] Additional Source APIs needed to support RTM execution#52501
Closed
jerrypeng wants to merge 2 commits intoapache:masterfrom
Closed
[SPARK-53784] Additional Source APIs needed to support RTM execution#52501jerrypeng wants to merge 2 commits intoapache:masterfrom
jerrypeng wants to merge 2 commits intoapache:masterfrom
Conversation
viirya
reviewed
Oct 4, 2025
| * Merge partitioned offsets coming from {@link SupportsRealTimeMode} instances | ||
| * for each partition to a single global offset. | ||
| */ | ||
| Offset mergeOffsets(PartitionOffset[] offsets); |
Member
There was a problem hiding this comment.
Is this used to compute the start offsets of the next batch?
Contributor
Author
There was a problem hiding this comment.
yes essentially. It is the function used to merge offsets returned by each partition at the end of batch which is the starting offset of the batch.
Member
|
Merged to master. Thanks @jerrypeng |
Contributor
Author
|
thanks @viirya ! |
huangxiaopingRD
pushed a commit
to huangxiaopingRD/spark
that referenced
this pull request
Nov 25, 2025
### What changes were proposed in this pull request? Described in the jira ticket: https://issues.apache.org/jira/browse/SPARK-53784 Here is an example for reference of how the API is used to craft a in-memory source that supports RTM: [sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/sources/LowLatencyMemoryStream.scala ](https://github.com/apache/spark/pull/52502/files#diff-b49f6f9fba5c2683792c52015219d3f29ed683cc2e676da8781c0e8b84a5e272) ### Why are the changes needed? Needed to support Real-time Mode time based batch execution in sources. ### Does this PR introduce _any_ user-facing change? Yes, adds additional APIs needed for sources to be able integrate with Real-time mode. ### How was this patch tested? Not applicable since only interfaces are introduced ### Was this patch authored or co-authored using generative AI tooling? no Closes apache#52501 from jerrypeng/SPARK-53784. Authored-by: Jerry Peng <jerry.peng@databricks.com> Signed-off-by: Liang-Chi Hsieh <viirya@gmail.com>
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?
Described in the jira ticket: https://issues.apache.org/jira/browse/SPARK-53784
Here is an example for reference of how the API is used to craft a in-memory source that supports RTM:
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/sources/LowLatencyMemoryStream.scala
Why are the changes needed?
Needed to support Real-time Mode time based batch execution in sources.
Does this PR introduce any user-facing change?
Yes, adds additional APIs needed for sources to be able integrate with Real-time mode.
How was this patch tested?
Not applicable since only interfaces are introduced
Was this patch authored or co-authored using generative AI tooling?
no