Skip to content

[iceberg] Fix missing parent snapshot id in createMetadataWithoutBase#8305

Open
weibangpeng wants to merge 1 commit into
apache:masterfrom
weibangpeng:master
Open

[iceberg] Fix missing parent snapshot id in createMetadataWithoutBase#8305
weibangpeng wants to merge 1 commit into
apache:masterfrom
weibangpeng:master

Conversation

@weibangpeng

Copy link
Copy Markdown
Contributor

Summary

  • Fix parent_id incorrectly set to null for non-first snapshots when createMetadataWithoutBase is used
  • Iceberg snapshots 2+ now have parentId = snapshotId - 1 instead of null

Root cause

When previous Iceberg metadata files are expired, createMetadata falls back to createMetadataWithoutBase, which hardcoded parentId = null regardless of whether it's the first snapshot or not. This breaks the Iceberg snapshot parent chain.

Fix

Use snapshotId - 1 as parentId for non-first snapshots (snapshot 1 correctly keeps parentId = null).

Closes #5860

When createMetadataWithoutBase is used for non-first snapshots,
the parent_id was incorrectly set to null, breaking Iceberg's
snapshot parent chain and preventing operations like
create_changelog_view from working correctly.

Closes apache#5860
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.

[Bug] Iceberg compatibility does not set the snapshot parent_id field

1 participant