Skip to content

fix: resolve scan snapshots during planning - #123

Merged
gabotechs merged 2 commits into
apache:mainfrom
alexanderbianchi:codex/fix-snapshot-resolution
Nov 20, 2026
Merged

gabotechs merged 2 commits into
apache:mainfrom
alexanderbianchi:codex/fix-snapshot-resolution

Conversation

@alexanderbianchi

@alexanderbianchi alexanderbianchi commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Closes #118.

Resolve the scan's snapshot during FileScanTaskProviderBuilder::build() and retain the resulting iceberg-rust TableScan. Lazy file discovery and statistics then use the same resolved snapshot, and a nonexistent snapshot ID fails during planning. File discovery remains deferred in lazy mode.

Preserve LazyFileScanTaskProvider::snapshot_id() semantics: None still means the current snapshot was requested. Add snapshot() to expose the resolved snapshot, returning None only for a table with no current snapshot.

Update the existing missing-snapshot unit test to expect a planning error. Existing tests retain coverage of current and historical snapshot statistics, empty tables, and scan execution. No additional integration tests are needed.

Validation:

  • Confirmed the lazy-planning regression test fails against the original implementation.
  • cargo test --workspace --locked
  • cargo clippy --workspace --locked --all-targets -- -D warnings
  • cargo fmt --all -- --check
  • git diff --check

Developed with AI assistance.

@gabotechs
gabotechs merged commit 8e11b74 into apache:main Nov 20, 2026
5 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.

Resolve the scan's snapshot once when building IcebergDataSource

2 participants