Skip to content

Support upgrading tables to format version 3#3623

Draft
moomindani wants to merge 2 commits into
apache:mainfrom
moomindani:moomindani/v3-upgrade
Draft

Support upgrading tables to format version 3#3623
moomindani wants to merge 2 commits into
apache:mainfrom
moomindani:moomindani/v3-upgrade

Conversation

@moomindani

Copy link
Copy Markdown

Closes #3622 (part of #1551)

Rationale for this change

Allow upgrading existing tables to format version 3: upgrade_table_version(3) is no longer rejected, and next-row-id is initialized to 0 on upgrade, following the spec's "Row Lineage for Upgraded Tables" (existing snapshots are left unmodified).

Draft until #3551 merges: persisting the upgraded metadata requires V3 metadata serialization, which #3551 enables. Until then the updated integration test (test_upgrade_table_version) fails at the metadata write. I'll rebase and mark this ready for review once #3551 lands.

Are these changes tested?

Yes. A new unit test (test_update_metadata_upgrade_to_v3) covers the upgrade producing TableMetadataV3 with next-row-id=0 including re-validation, and the test_upgrade_table_version integration test is updated to upgrade to v3 (currently blocked on #3551 as noted above).

Are there any user-facing changes?

Yes: v2 tables can be upgraded to v3 via upgrade_table_version(3) once V3 metadata serialization (#3551) is available.

This pull request and its description were written by Claude Fable 5.

Allow upgrade_table_version(3) and initialize next-row-id to 0 on
upgrade, per the spec's Row Lineage for Upgraded Tables. Persisting
the upgraded metadata still requires V3 metadata serialization (apache#3551).

Closes apache#3622
@moomindani moomindani force-pushed the moomindani/v3-upgrade branch from 4f3e899 to 44631e0 Compare July 8, 2026 12:06
Support upgrading via the format-version table property in
set_properties, matching TableMetadata.replaceProperties in Java: the
property triggers UpgradeFormatVersionUpdate instead of being stored.
Add tests for parity with TestTableMetadata and TestRowLineageMetadata:
direct v1-to-v3 upgrade, same-version no-op, and property-based
upgrade.
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.

Support upgrading tables to format version 3

1 participant