Skip to content

feat(table): port remaining v3 metadata-upgrade validation rules#1070

Merged
laskoviymishka merged 1 commit into
apache:mainfrom
tanmayrauth:feat/table-port-remaining-v3-metadata-upgrade-validation-rules-1013
May 12, 2026
Merged

feat(table): port remaining v3 metadata-upgrade validation rules#1070
laskoviymishka merged 1 commit into
apache:mainfrom
tanmayrauth:feat/table-port-remaining-v3-metadata-upgrade-validation-rules-1013

Conversation

@tanmayrauth
Copy link
Copy Markdown
Contributor

Add missing validation rules to SetFormatVersion that mirror Java's TableMetadata upgrade checks:

  • Initialize lastSequenceNumber to 0 when upgrading from v1 to v2+
  • Initialize nextRowID to 0 when upgrading to v3
  • Assign UUID if not already set when upgrading to v2+
  • Validate lastColumnId is not less than the highest field ID in schemas

Validation runs before state mutation to prevent leaving the builder in a half-upgraded state on failure.

Closes #1013

Add missing validation rules to SetFormatVersion that mirror Java's
TableMetadata upgrade checks:

- Initialize lastSequenceNumber to 0 when upgrading from v1 to v2+
- Initialize nextRowID to 0 when upgrading to v3
- Assign UUID if not already set when upgrading to v2+
- Validate lastColumnId is not less than the highest field ID in schemas

Validation runs before state mutation to prevent leaving the builder
in a half-upgraded state on failure.

Closes apache#1013
@tanmayrauth tanmayrauth requested a review from zeroshade as a code owner May 11, 2026 17:55
@tanmayrauth
Copy link
Copy Markdown
Contributor Author

@laskoviymishka can you please review this PR?

Copy link
Copy Markdown
Contributor

@laskoviymishka laskoviymishka left a comment

Choose a reason for hiding this comment

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

nice a clean!

@laskoviymishka laskoviymishka merged commit 40b8125 into apache:main May 12, 2026
14 checks passed
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.

feat(table): port remaining v3 metadata-upgrade validation rules

2 participants