Skip to content

fix: preserve snapshot ID width in UseRef#661

Merged
wgtmac merged 1 commit into
apache:mainfrom
fallintoplace:fix/use-ref-int64-snapshot-id
May 20, 2026
Merged

fix: preserve snapshot ID width in UseRef#661
wgtmac merged 1 commit into
apache:mainfrom
fallintoplace:fix/use-ref-int64-snapshot-id

Conversation

@fallintoplace
Copy link
Copy Markdown
Contributor

Summary

  • keep UseRef() snapshot IDs as int64_t while resolving refs
  • add a regression test for a ref pointing at INT32_MAX + 42

Root Cause

TableScanBuilder::UseRef() copied SnapshotRef::snapshot_id into an int32_t, even though snapshot IDs are modeled as int64_t in refs, metadata lookup, and scan context.

Testing

  • uvx cmake --build build --target scan_test -j 8
  • ./build/src/iceberg/test/scan_test --gtest_filter=*UseRefPreservesInt64SnapshotIds*
  • ./build/src/iceberg/test/scan_test

Fixes #660

@fallintoplace fallintoplace force-pushed the fix/use-ref-int64-snapshot-id branch from f69c0b7 to 42f0472 Compare May 19, 2026 22:40
Copy link
Copy Markdown
Member

@wgtmac wgtmac left a comment

Choose a reason for hiding this comment

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

Good catch! Thanks for fixing this!

@wgtmac wgtmac merged commit 83aa988 into apache:main May 20, 2026
15 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.

TableScanBuilder::UseRef truncates snapshot IDs above INT32_MAX

2 participants