You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Iceberg: re-plan views from their SQL so they read the latest table version #2726
ballista-iceberg pins each catalog-backed Iceberg table to the version its catalog serves when a query is planned, so every scan in the query, such as each side of a self-join, reads the same version, and encoding plans needs no I/O.
A view stores a planned query, so it keeps the version from when it was created. In single-process DataFusion, a view over IcebergCatalogTableProvider picks up new commits each time it runs. On Ballista it doesn't, so the same code gives different results once it moves to Ballista. The same goes for a DataFrame or a Flight SQL prepared statement run more than once. This is documented as a limitation in #2638.
Describe the solution you'd like
Re-plan a view from its SQL each time a query uses it, as Spark does: Spark stores a view's SQL text and analyzes it again for every query that references it, so its tables resolve to their current versions.
DataFusion's ViewTable already keeps the SQL it was created from (ViewTable::definition()). ballista-iceberg's pinning schema wrapper, which already sees every table lookup, could re-plan a view that has a definition when it's looked up, pinning its Iceberg tables to the versions current at that time.
Open questions:
SchemaProvider::table gets no session state to plan the SQL with.
A view created without SQL, such as from a DataFrame, has no definition to re-plan.
Whether reused DataFrames and prepared statements should re-plan too, and how.
Describe alternatives you've considered
Pin tables when the scheduler receives the plan rather than when the client plans it. Views would still hold the client's plan, and encoding would need catalog I/O.
Activity
NoahKusaba commentedon Nov 3, 2026
Fixed in 9025298 on #2638.