Skip to content

refactor: delegate catalog scans to static table provider - #69

Draft
alexanderbianchi wants to merge 1 commit into
apache:mainfrom
alexanderbianchi:refactor/catalog-delegates-static-scan
Draft

alexanderbianchi wants to merge 1 commit into
apache:mainfrom
alexanderbianchi:refactor/catalog-delegates-static-scan

Conversation

@alexanderbianchi

Copy link
Copy Markdown

What changes

Have IcebergCatalogTableProvider::scan() load the latest table and construct a per-scan IcebergStaticTableProvider, then delegate to its scan(). The catalog provider keeps ownership of catalog refresh and writes; the static provider owns the read-plan construction. This PR is based on main and does not add eager file planning or depend on #67.

The generated static provider uses the catalog provider's cached Arrow schema instead of re-deriving a schema from the freshly loaded table. This preserves the existing contract: after the table evolves, a provider created before the schema change still exposes and scans its original columns. No public constructor or wire format changes.

The existing schema-evolution test now also scans a projected column after the table changes, checking that projection indices still refer to the provider's original schema. Existing catalog insert and lazy-read tests continue to run.

This is a separate refactor from #67; because both change the catalog scan method, whichever merges second may need a rebase.

Validation

  • cargo test -p iceberg-datafusion --locked --test integration_datafusion_test test_scan_after_schema_evolution_reads_provider_columns: pass.
  • cargo fmt --all -- --check: pass.
  • cargo clippy --workspace --locked --all-targets -- -D warnings: pass.
  • cargo test --workspace --locked: pass.
  • git diff --check: pass.

AI disclosure

Developed with AI assistance and validated locally before opening as a draft.

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.

1 participant