Spark: Add streaming-starting-offset read option to control stream start position#15472
Closed
sergiomartinswhg wants to merge 2 commits into
Closed
Spark: Add streaming-starting-offset read option to control stream start position#15472sergiomartinswhg wants to merge 2 commits into
sergiomartinswhg wants to merge 2 commits into
Conversation
|
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@iceberg.apache.org list. Thank you for your contributions. |
|
This pull request has been closed due to lack of activity. This is not a judgement on the merit of the PR in any way. It is just a way of keeping the PR queue manageable. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time. |
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.
Context
This PR addresses a common streaming pattern in Iceberg by adding the ability to dictate exactly where a Spark stream starts reading when no previous checkpoint exists.
Related PRs:
Summary
This PR adds a new
streaming-starting-offsetoption that provides flexibility for bootstrapping Spark Structured Streaming queries. Previously, Iceberg streams defaulted to starting from the oldest snapshot or required a specificstream-from-timestamp. This PR introduces four distinct starting modes, allowing users to easily skip historical data or perform a full table scan bootstrap before switching to incremental processing.Motivation
When starting a new stream against an existing Iceberg table, users often need specific starting points. Currently, the default behavior incrementally processes from the oldest available (unexpired) snapshot. While useful for historical backfills, this lacks support for two very common streaming architectures:
Changes
New option:
streaming-starting-offsetproviding four distinct starting behaviors:earliest(default)latestearliest-snapshotlatest-snapshotCompatibility & Precedence:
streaming-starting-offsetis entirely ignored if a checkpoint already exists.streaming-starting-offsetandstream-from-timestampare mutually exclusive in intent.stream-from-timestamptakes precedence to maintain backward compatibility, and a warning is logged.Usage
All feedback and reviews are highly welcome!