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
Feature: Revive atomic REPLACE TABLE support in PyIceberg #4485
I’d like to revive support for atomic table replacement (RTAS) in PyIceberg.
This functionality already exists in Apache Iceberg Java through createOrReplaceTransaction(), but there is no equivalent high-level API in PyIceberg.
The feature was previously discussed in #281, with implementations proposed in #433 and, more recently, #3220. Unfortunately, the latter was closed due to inactivity without being merged.
Why this matters
With Polars 2.2 introducing extensive Iceberg SQL support, atomic CREATE OR REPLACE TABLE AS SELECT is one of the remaining capabilities needed for production-grade dbt workloads.
It allows rebuilding and replacing tables without risking downtime or broken downstream pipelines if a transformation fails.
Since Polars relies on PyIceberg for catalog operations and commits, implementing this upstream would directly benefit Polars and potentially other Python-based engines.
Proposed direction
The previous PR #3220 already introduced a promising API:
with catalog.replace_table_transaction(
identifier="analytics.orders",
schema=new_schema,
) as tx:
tx.append(data)
Ideally, this would provide atomic replacement of data and metadata, preserve Iceberg history, and support REST catalogs.
Would the maintainers be open to reviving #3220, or is there a preferred alternative approach?
Activity
Add atomic create or replace table