Skip to content

[Data] Delta DataSource V2: resume a checkpointed read at the version the first run read #68812

Todo

Description

@abhishekverma-ray

Description

A checkpointed read_delta (CheckpointConfig(generated_id_column=...)) on the DataSource V2 reader can fail on resume even though nothing would go wrong. Two cases:

  1. The table changed between the run and its rerun. Without version=, the resumed job reads whatever version is latest when it restarts.
    • A generated ID records a row's position in its data file.
    • If a commit in between rewrote files the first run finished (OPTIMIZE, an overwrite), their rows now sit in new files with new IDs.
    • So the listing raises InvalidCheckpointingConfig instead of writing those rows a second time. The first run logs a warning that names the version= to pass, and test_generated_id_resume_of_the_latest_version covers this.
    • Proposal: store the version the first run read in the checkpoint, and have the resumed job read that version unless the caller passes another. A resume then works after a compaction, as long as VACUUM hasn't deleted the old files.
  2. partition_filters changed between the run and its rerun. partition_filters selects files before the resume check ([Data][Delta DSv2][7/11] Apply partition_filters in the Delta DataSourceV2 reader #68330), so the check sees only the selected files.
    • Rerunning with a narrower filter, such as p = 'a' after p in ('a', 'b'), raises InvalidCheckpointingConfig, even though nothing was rewritten and continuing would be safe.
    • The message, "A commit since the checkpointed run rewrote them", points to the wrong cause.
    • Proposal: also name a change to partition_filters as a possible cause in the error message.
    • Selecting files first helps in the other direction: rewriting a partition the filter doesn't select no longer fails a resume.

Repro for both, at #68330, with a table partitioned by p with values a, b and c, two files each. The first run reads with partition_filters=[("p", "in", ["a", "b"])]:

Rerun Result
Same filter, table unchanged Works, no rows written twice
OPTIMIZE on p = 'c' Works
OPTIMIZE on p = 'a' InvalidCheckpointingConfig (case 1)
Narrower filter p = 'a', table unchanged InvalidCheckpointingConfig (case 2)

Use case

A long checkpointed job that reads the latest version of a Delta table should be able to resume after a failure. Today it fails if scheduled compaction ran in between, unless the user pinned version= before the first run.

Activity

  1. added
    data
    on Dec 4, 2026
  2. PCTEJA commented on Dec 4, 2026

    @PCTEJA
    Contributor

    Hey, I hit this same resume failure on a checkpointed Delta read and would like to take a shot at fixing it if you are not already on it. The shape I would go with is storing the version the first run read in the checkpoint so the resume reads that version unless the caller passes another, plus naming a partition_filters change as a possible cause in the error message. Do you already have a fix in progress for this, or a preferred shape for the version pinning?

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

Metadata

Metadata

Labels

data

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions