Skip to content

[rust] Add SnapshotId type alias and use it in snapshot metadata paths#657

Open
Olawoyin007 wants to merge 1 commit into
apache:mainfrom
Olawoyin007:snapshot-id-alias
Open

[rust] Add SnapshotId type alias and use it in snapshot metadata paths#657
Olawoyin007 wants to merge 1 commit into
apache:mainfrom
Olawoyin007:snapshot-id-alias

Conversation

@Olawoyin007

@Olawoyin007 Olawoyin007 commented Jul 9, 2026

Copy link
Copy Markdown

Purpose

Linked issue: close #636

TableId, PartitionId, and BucketId already have type aliases in lib.rs (extended to the write path in #635), but snapshot_id was still spelled i64 everywhere. This adds a matching SnapshotId alias so snapshot-related signatures read consistently with the other ID types.

Brief change log

  • Add pub type SnapshotId = i64; next to the existing aliases in lib.rs.
  • Apply it to the hand-written sites: LakeSnapshot (metadata/table.rs), LakeSnapshotInfo, KvSnapshot, KvSnapshotLeaseForBucket, the admin client methods (get_kv_snapshot_metadata, get_lake_snapshot), and the GetKvSnapshotMetadataRequest / GetLakeSnapshotRequest constructors.
  • Generated proto code is untouched; HashMap<TableBucket, i64> offset values stay i64 since they are offsets, not snapshot IDs.

Tests

No behavior change (the alias resolves to the same type). cargo test --workspace: 576 passed, 0 failed. cargo clippy --workspace --all-targets and cargo fmt --all --check are clean.

API and Format

Public signatures now name SnapshotId instead of i64; since it is a plain type alias, this is source- and ABI-compatible. No storage format impact.

Documentation

No new feature; no documentation changes needed.

🤖 Generated with Claude Code

Follow-up to apache#635: TableId, PartitionId, and BucketId already have
aliases in lib.rs, but snapshot_id was still spelled i64 everywhere.
Add a matching SnapshotId alias and apply it to the hand-written sites:
LakeSnapshot, LakeSnapshotInfo, KvSnapshot, KvSnapshotLeaseForBucket,
the admin client methods, and the get_kv_snapshot_metadata /
get_lake_snapshot request constructors.
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.

[rust] Add a SnapshotId type alias

1 participant