Skip to content

refactor(spec): adopt ViewVersionId type alias everywhere - #3526

Open
dannycjones wants to merge 1 commit into
apache:mainfrom
dannycjones:refactor/view-version-id-type-alias
Open

dannycjones wants to merge 1 commit into
apache:mainfrom
dannycjones:refactor/view-version-id-type-alias

Conversation

@dannycjones

@dannycjones dannycjones commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Addresses part of #3524.

What changes are included in this PR?

Adopt existing ViewVersionId alias where it wasn't already.

Additionally, it corrects a mistake where a SchemaId alias was used in the wrong place.

Are these changes tested?

N/A

AI Disclosure

LLM used for obvious reasons - this is just a lot of find and replace. :)

Owned and reviewed by me.

Replace bare i32 with the existing ViewVersionId type alias wherever a value is a view version ID: ViewMetadataBuilder methods and helpers, ViewVersion::with_version_id, ViewUpdate::SetCurrentViewVersion, INITIAL_VIEW_VERSION_ID and the view version serde type.

ViewMetadataBuilder::last_added_version_id was typed as Option<SchemaId>; it holds a view version ID, so it is now Option<ViewVersionId>.

Both aliases are i32, so this is a type-spelling change only.

Co-authored-by: Danny C Jones <djonesoa@amazon.com>
@dannycjones dannycjones changed the title refactor(spec): use ViewVersionId alias for view version IDs refactor(spec): adopt ViewVersionId type alias everywhere Oct 24, 2026
@dannycjones
dannycjones marked this pull request as ready for review October 30, 2026 13:35
Copilot AI balanced review requested due to automatic review settings October 30, 2026 13:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues block the ViewVersionId type-alias updates.

No open issues 🎉

What changed in this PR

This PR advances #3524 by consistently using the existing ViewVersionId alias across view metadata and catalog updates, without changing runtime behavior.

Changes:

  • Replaces raw i32 view-version annotations with ViewVersionId.
  • Corrects last_added_version_id from SchemaId to ViewVersionId.
  • Updates the public API snapshot to match the signatures.
File Description
crates/​iceberg/​src/​spec/​view_version.rs Uses the alias in the version setter and serialization struct.
crates/​iceberg/​src/​spec/​view_metadata.rs Types the initial view-version ID with the alias.
crates/​iceberg/​src/​spec/​view_metadata_builder.rs Aligns version tracking, helpers, and history filtering with the alias.
crates/​iceberg/​src/​catalog/​mod.rs Uses the alias in the current-view-version update field.
crates/​iceberg/​public-api.txt Records the updated public type annotations.

Review effort: Balanced

This branch has not been deployed

No deployments
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.

2 participants