Skip to content

Core: Support explicit row ID assignment in manifest rewrites - #17446

Draft
timothyw553 wants to merge 3 commits into
apache:mainfrom
timothyw553:es-2084092-manifest-row-id-prototype
Draft

Core: Support explicit row ID assignment in manifest rewrites#17446
timothyw553 wants to merge 3 commits into
apache:mainfrom
timothyw553:es-2084092-manifest-row-id-prototype

Conversation

@timothyw553

@timothyw553 timothyw553 commented Jul 31, 2026

Copy link
Copy Markdown

Problem

Iceberg format v3 requires row IDs for data files. A large-table upgrade may calculate those assignments in parallel, but RewriteManifests currently cannot reserve a caller-defined row-ID range while replacing manifests directly.

This matters when the table must keep its existing snapshot ancestry. An OSS Spark streaming checkpoint stores an Iceberg snapshot ID. If an upgrade removes that snapshot from the current lineage, the stream cannot resume.

Change

This adds a low-level API for distributed manifest replacement:

  • ManifestFiles.rewriteDataManifestWithFirstRowIds writes replacement data manifests containing EXISTING entries with explicit first_row_id values.
  • Each replacement preserves the original entry's snapshot ID, data sequence number, and file sequence number.
  • RewriteManifests.reserveRowIdRange advances the table's next-row-id while committing those manifests.
  • The commit rejects non-v3 tables, partial replacement of legacy data manifests, concurrent snapshot changes, concurrent next-row-id changes, invalid ranges, and overlaps within a manifest.
  • The caller remains responsible for validating that row-ID ranges are globally disjoint across manifests. This is documented because the core commit intentionally does not collect every manifest entry onto one process.

Normal manifest rewrites are unchanged unless the new API is used.

Correctness requirements

A caller using this API must preserve the live data-file set, replace every current data manifest that lacks row IDs, preserve entry sequence metadata, and assign one non-overlapping row-ID range per live file.

Validation

  • Full TestRowLineageAssignment suite
  • Spark 4 structured-streaming test through both Hive and REST catalogs
  • The streaming test checkpoints a v2 table, performs the v3 manifest replacement, appends data, and resumes twice from the same checkpoint without loss or replay
  • API/core Revapi
  • API, core, and Spark formatting checks
  • git diff --check

Generated-by: OpenAI Codex GPT-5
@timothyw553 timothyw553 changed the title Prototype: preserve snapshots while assigning first row IDs Core: Support explicit row ID assignment in manifest rewrites Jul 31, 2026
Validate the reserved row ID range, reject partial legacy manifest replacement and concurrent row lineage changes, and cover checkpoint continuation across a v2-to-v3 upgrade.

Generated-by: Codex GPT-5
@timothyw553
timothyw553 force-pushed the es-2084092-manifest-row-id-prototype branch from 4845214 to 725f41a Compare July 31, 2026 12:41
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.

1 participant