Skip to content

Conversation

jerrypeng
Copy link
Contributor

@jerrypeng jerrypeng commented Oct 2, 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

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

* Merge partitioned offsets coming from {@link SupportsRealTimeMode} instances
* for each partition to a single global offset.
*/
Offset mergeOffsets(PartitionOffset[] offsets);
Copy link
Member

Choose a reason for hiding this comment

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

Is this used to compute the start offsets of the next batch?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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.

Copy link
Member

@viirya viirya left a comment

Choose a reason for hiding this comment

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

@viirya viirya closed this in 6bcd095 Oct 7, 2025
@viirya
Copy link
Member

viirya commented Oct 7, 2025

Merged to master. Thanks @jerrypeng

@jerrypeng
Copy link
Contributor Author

thanks @viirya !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants