Skip to content

[spark] Advance streaming source past empty full snapshots - #9401

Merged
JingsongLi merged 3 commits into
apache:masterfrom
lilei1128:fix-empty-snapshot-streaming
Aug 27, 2026
Merged

[spark] Advance streaming source past empty full snapshots#9401
JingsongLi merged 3 commits into
apache:masterfrom
lilei1128:fix-empty-snapshot-streaming

Conversation

@lilei1128

@lilei1128 lilei1128 commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Purpose

When a Spark streaming source started in latest-full or
from-snapshot-full mode from an empty snapshot, no end offset was
generated and the source could not continue with subsequent delta
snapshots. With consumer-id configured, the consumer checkpoint also
remained unchanged.

Generate a completion offset for empty full snapshots, advance the
source and consumer to the next snapshot, preserve correct
ReadMinRows behavior, and support checkpoint recovery while keeping
legacy offset compatibility.

  • Mark an existing zero-split full snapshot as completed and generate an end offset.

  • Store the next snapshot position in that offset and resume subsequent reads in delta mode.

  • Advance the Paimon consumer when the empty full snapshot is committed.

  • Keep ReadMinRows semantics for batches containing actual delta data.

  • Preserve the empty-snapshot state across Spark checkpoint serialization and restart.

  • Keep legacy offsets without totalSplits readable.

  • Prevent inconsistent totalSplits metadata when offsets are copied.

    fix [spark] Streaming source cannot advance past an empty initial full snapshot #9308

Tests

Tests cover:

  • Empty snapshot offset serialization and copy behavior;
  • Source advancement with and without consumer-id;
  • Consumer checkpoint updates and retry failures;
  • ReadMinRows delay and recovery;
  • Spark query restart from checkpoint;
  • Continued consumption of data after the empty snapshot;
  • Existing full-snapshot, delta, trigger, and read-limit behavior.

@JingsongLi

Copy link
Copy Markdown
Contributor

+1

@JingsongLi
JingsongLi merged commit 483c968 into apache:master Aug 27, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[spark] Streaming source cannot advance past an empty initial full snapshot

2 participants