Skip to content

Conversation

@aditya-subrahmanyan
Copy link
Contributor

Which issue does this PR close?

What changes are included in this PR?

Make row lineage fields first-row-id and added-rows optional in SnapshotV3 to support upgrading tables of older versions with pre-existing snapshots. According to the Iceberg spec, existing snapshots should remain unchanged during upgrades from to v3.

Additionally, this also fixes the initialization of the next-row-id during upgrades, as defined in the spec:
https://iceberg.apache.org/spec/#row-lineage-for-upgraded-tables.

Are these changes tested?

Added tests to validate v2 to v3 upgrade for table metadata, as described in the issue, and confirm that row lineage information is preserved/generated correctly.

Make row lineage fields `first-row-i` and `added-rows` optional in
SnapshotV3 to support upgrading tables of older versions with
pre-existing snapshots. According to the Iceberg spec, existing
snapshots should remain unchanged during upgrades from to v3.

Additionally, this also fixes the initialization of the next-row-id
during upgrades, as defined in the spec:
https://iceberg.apache.org/spec/#row-lineage-for-upgraded-tables.
@aditya-subrahmanyan aditya-subrahmanyan marked this pull request as ready for review January 11, 2026 02:28
Copy link
Collaborator

@CTTY CTTY left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@aditya-subrahmanyan
Copy link
Contributor Author

Thanks @CTTY!

@liurenjie1024 @kevinjqliu could you please sign off on this PR if it looks good to you? Thanks.

Copy link
Contributor

@liurenjie1024 liurenjie1024 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @aditya-subrahmanyan for this fix!

@aditya-subrahmanyan
Copy link
Contributor Author

Thanks for the review @liurenjie1024, please merge the PR when you get chance.

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.

v2 to v3 upgrade fails to serialize table metadata with existing snapshots

3 participants