Iceberg Schema Evolution: A Practical Guide to Safe Changes
Learn how Iceberg uses field IDs for safe schema evolution. Compare renames, type changes and column reuse, then check a schema change before rollout.
Iceberg schema evolution is metadata-only: adding, dropping, renaming, reordering, and widening column types commit new table metadata and never rewrite data files, because every field carries a permanent ID. The limits are narrower but real — map keys cannot add or drop struct fields that would change equality, type promotion is blocked when a partition transform would produce a different value, and the DDL surface differs by engine. This guide gives US and Singapore data engineers a scenario checklist and a runnable local fixture to test each change before it reaches production.
By jackey.ye · Updated 2026-12-01
What Is the Real Boundary Between a Metadata-Only Change and a Data Rewrite?
The schema change itself is metadata-only; anything that has to touch existing rows is a separate data operation you plan and budget for.
The Apache Iceberg evolution documentation lists five supported schema changes — add, drop, rename, update (widen a type), and reorder — and states plainly that "Iceberg schema updates are metadata changes, so no data files need to be rewritten to perform the update." Each commit writes a new table metadata file and swaps the pointer atomically; the table spec describes that swap as the mechanism by which all table state changes are committed.
The boundary sits between the commit and what readers do afterward:
Reading old files under a new type. The promotion is recorded in metadata, but the engine must apply the promotion rule at read time. If the engine does not implement a given promotion, the commit can succeed and the query can still fail.
Backfilling a dropped-and-re-added column. Iceberg will not resurrect history for a new field ID. Filling those rows is an ETL job against your own storage, not part of schema evolution.
Rewriting for layout reasons. Compaction, partition-layout changes, and sort-order changes are separate operations. The evolution page treats partition evolution and sort-order evolution as metadata operations too, but neither one rewrites files eagerly.
The one documented schema restriction in that page is worth quoting directly: "map keys do not support adding or dropping struct fields that would change equality." If a map key is a struct and the change would alter how keys compare, the change is out of bounds regardless of engine.
A worked illustration makes the distinction concrete. Suppose orders has amount decimal(10,2) and a downstream finance model expects decimal(12,2). Widening precision is a metadata commit; no Parquet file is rewritten. But if the finance model also needs amount re-expressed in a reporting currency for historical rows, that is a backfill — new files, new snapshot, and a separate review. Treat the two as different change tickets with different rollback stories.
Why Do Iceberg Field IDs Make Rename and Reorder Safe?
Because names and positions are labels over stable integer IDs, a rename or reorder changes the label, not the identity of the column whose values live in existing files.
The schemas page states that Iceberg "tracks each field in a table using an ID that is never reused in a table." The table spec carries the counter that enforces this: last-column-id is "the highest assigned column ID for the table," used "to ensure columns are always assigned an unused ID when evolving schemas." Every new field, including fields inside nested structs, draws a fresh ID above that watermark.
The evolution page turns this into four correctness guarantees, each of which holds without rewriting files:
Added columns never read existing values from another column.
Dropping a column or field does not change the values in any other column.
Updating a column or field does not change values in any other column.
Changing the order of columns or fields in a struct does not change the values associated with a column or field name.
The page also names the failure modes this design avoids. Formats that track columns by name "can inadvertently un-delete a column if a name is reused, which violates #1" — you drop legacy_score, later create a new column with the same name, and old files suddenly surface values that were never meant to reappear. Formats that track by position "cannot delete columns without changing the names that are used for each column, which violates #2" — dropping the third column silently shifts every column after it.
For a reader auditing a table, the practical consequence is that DESCRIBE output is not the source of truth for identity. Two schemas that look identical by name and order can differ in field IDs, and that difference is what determines whether a query reads the right bytes.
What Breaks When You Drop and Re-Add a Column?
The re-added column is a new column: it receives a fresh field ID, so every historical row reads as null for it and anything still bound to the old ID loses its data path.
This is the most common surprise in schema evolution, and it is not a bug. The never-reused ID rule from the schemas page means DROP COLUMN retires an ID permanently; a later ADD COLUMN with the same name draws a new one. Iceberg is behaving exactly as specified — the two columns merely share a name.
Three failure modes follow, and each has a different blast radius:
Dashboards expecting history. A BI extract that sums the re-added column returns nulls for every row written before the re-add. The report does not error; it silently under-reports.
Partition specs bound to the old ID. Partition fields reference their source column by
source-id, per the table spec. A partition field still pointing at the retired ID no longer describes the new column, and pruning behaves according to the old spec for old files.Constraints and delete logic keyed to field IDs. The spec stores constraints separately from the schema and requires them to "refer to fields by field ID." A check constraint or equality-delete predicate written against the retired ID does not automatically follow the new column.
The safe pattern is a three-release migration rather than a single DDL statement:
Add the new column under a distinct name and leave the old one in place.
Backfill historical rows into the new column with your own job, and validate row counts against the source.
Migrate consumers — views, extracts, CDC sinks, contracts — to the new name, and confirm no query references the old one.
Drop the old column only after the migration window closes.
None of this is a limitation of schema evolution. It is a data-migration decision, and it deserves the same review as any other backfill.
Which Schema Changes Are Unsupported or Engine-Dependent?
Three tiers matter: what the spec permits, what the spec forbids under specific conditions, and what your engine's DDL actually exposes.
Tier 1 — spec-level supported changes. Add, drop, rename, update (widen), and reorder, including inside nested structs, per the evolution page.
Tier 2 — spec-level restrictions. The table spec's promotion table allows only these widenings: int to long, float to double, and decimal(P, S) to decimal(P', S) where P' > P — "widen precision only." In v3 and later, date may promote to timestamp or timestamp_ns, but "promotion to timestamptz or timestamptz_ns is not allowed," and values outside the promoted type's range "must result in a runtime failure." The spec also blocks promotion when a partition source would hash differently: bucket[N] "produces different hash values for 34 and "34" … but the same value for 34 and 34L; when an int field is the source for a bucket partition field, it may be promoted to long but not to string."
Tier 3 — engine-dependent DDL. The Spark DDL reference documents ALTER TABLE support for adding columns in any position with FIRST or AFTER, renaming any field with RENAME COLUMN, and using ALTER COLUMN to "widen types, make a field optional, set comments, and reorder fields." Flink and Trino expose their own subsets; check your engine's reference before assuming a Spark-documented statement exists elsewhere.
Change type | Spec support | Data rewrite needed | Engine caveat | Verification step |
|---|---|---|---|---|
Add column (top level or nested) | Supported | No | Position clauses ( | Confirm the new field ID exceeds the prior |
Drop column | Supported | No | Retired ID is never reused; consumers referencing it break silently | Grep views, extracts, and partition specs for the old name and |
Rename column or nested field | Supported | No | Name-based consumers (BI, contracts) must be updated separately | Query pre-rename rows and confirm values still resolve |
Widen | Supported | No | Blocked if a bucket partition source would hash differently | Compare partition values before and after for a sample of rows |
Widen | Supported (precision only) | No | Scale is fixed; precision must stay ≤ 38 | Read a pre-change row and confirm no rounding change |
| v3+ only | No | Not allowed to | Test boundary dates from the oldest snapshot |
Reorder columns or struct fields | Supported | No | Positional consumers (CSV exports, fixed-index readers) break | Re-run the consumer's query and diff the output |
Map key struct add/drop changing equality | Not supported | N/A | Documented restriction, engine-independent | Model the change as a new map column plus backfill instead |
How Do You Verify a Schema Change in a Disposable Local Fixture?
Run the change against a throwaway local warehouse first, capture the field IDs before and after, and confirm old rows still resolve — all of it against a disposable local database that you delete at the end.
The fixture below uses a local Spark session with the Iceberg Spark runtime and a Hadoop catalog rooted at a temporary directory. Nothing touches a shared catalog or production storage. Every output block is labelled as expected output that was not executed in this article; run it in your own environment and compare.
Create a disposable warehouse directory. Use a path under your system temp directory, for example
/tmp/iceberg-fixture-<your-initials>. Confirm it is empty before starting.Start a local Spark shell with the Iceberg runtime. Launch
spark-shell(orpyspark) with the Iceberg Spark runtime JAR on the classpath, then configure a Hadoop catalog pointed at your temp directory:
CREATE NAMESPACE IF NOT EXISTS local_fixture;
USE local_fixture;
Expected output (not executed in this article): the namespace is created and the session switches to it without error.
Create the table and insert two rows.
CREATE TABLE orders (
order_id bigint,
amount decimal(10,2),
note string
) USING iceberg;
INSERT INTO orders VALUES (1, 10.50, 'first'), (2, 20.25, 'second');
Expected output (not executed in this article): two rows inserted; SELECT count(*) FROM orders returns 2.
Capture the field IDs before the change. Query the table's schema metadata and record the
idfor each column:
SELECT id, name, type, required
FROM local_fixture.orders.schema_fields
ORDER BY id;
Expected output (not executed in this article): three rows, with order_id, amount, and note each holding a distinct integer ID. Write these down — they are your baseline.
Perform a rename and a widen in one session.
ALTER TABLE orders RENAME COLUMN note TO customer_note;
ALTER TABLE orders ALTER COLUMN amount TYPE decimal(12,2);
Expected output (not executed in this article): both statements complete successfully; no data files are rewritten.
Re-capture the field IDs and diff against the baseline.
SELECT id, name, type, required
FROM local_fixture.orders.schema_fields
ORDER BY id;
Expected output (not executed in this article): the ID for customer_note is identical to the ID previously held by note; the ID for amount is unchanged while its type now reads decimal(12,2).
Insert a new row and query across the change boundary.
INSERT INTO orders VALUES (3, 30.75, 'third');
SELECT order_id, amount, customer_note FROM orders ORDER BY order_id;
Expected output (not executed in this article): three rows returned; rows 1 and 2 carry their original amount values and their original note text now surfaced under customer_note; row 3 carries the new values.
Prove the drop-and-re-add trap. Add a column, drop it, re-add it under the same name, and query:
ALTER TABLE orders ADD COLUMN legacy_flag string;
INSERT INTO orders VALUES (4, 40.00, 'fourth', 'x');
ALTER TABLE orders DROP COLUMN legacy_flag;
ALTER TABLE orders ADD COLUMN legacy_flag string;
SELECT order_id, legacy_flag FROM orders ORDER BY order_id;
Expected output (not executed in this article): legacy_flag is null for every row, including row 4, because the re-added column has a new field ID.
Tear down. Drop the namespace and delete the temp warehouse directory:
DROP TABLE orders;
DROP NAMESPACE local_fixture;
Then remove the temp directory from your filesystem. Nothing persists.
If you prefer not to run SQL at all, the checklist in the next section covers the same decisions as a review artifact. For the partition side of the same problem — how layout changes interact with pruning — see Iceberg hidden partitioning and query filters and Iceberg partition evolution.
What Should a Pre-Change Checklist Cover for Consumers and Rollback?
Every row below is a gate: if the answer is not recorded before the commit, the change is not ready.
Change | Consumer impact to confirm | Partition-spec dependency | Rollback path | Verification query |
|---|---|---|---|---|
Add column | No consumer assumes a fixed column count | None | Drop the column (ID retired) | Confirm new ID > prior |
Drop column | Views, extracts, CDC sinks, contracts all migrated | Check no partition field uses its | Re-add gives a new ID; history is not restored | Grep catalog and repo for the old name |
Rename | Name-based consumers updated in the same window | None (ID unchanged) | Rename back | Query pre-rename rows under the new name |
Widen type | Downstream casts and schemas accept the wider type | Blocked if bucket hash would change | Narrowing is not a supported promotion | Read oldest-snapshot rows; compare values |
Reorder | No positional readers (CSV, index-based parsers) | None | Reorder back | Diff consumer output before and after |
Nested struct field | Serializers that flatten structs are updated | None unless the struct is a partition source | Reverse operation on the same field ID | Select the struct and inspect keys |
Map key change | Confirm the change does not alter key equality | None | Not supported; plan a new column instead | Compare key sets across snapshots |
Rollback deserves its own line because it is widely misunderstood. A schema change is a metadata commit, so reverting means committing the prior schema — but data written under the new schema may not read cleanly under the old one. If you widened int to long and wrote values above the int range, reverting the type does not make those values readable. Decide the rollback before the change, and prefer a forward fix over a revert once new data exists.
Finally, schedule the change window and notify consumers. A metadata commit is fast, but the consumer migration around it is not. For the broader contract-and-replay pattern across bronze, silver, and gold layers, see medallion architecture schema evolution.
FAQ
Does Iceberg rewrite data files when I add a column? No. Adding a column is a metadata change, and the new field receives a fresh ID so existing files are never read against it. See the boundary section.
Can I rename a column without breaking existing queries? Yes for Iceberg-aware readers, because the field ID is unchanged; name-based consumers such as BI extracts and schema registries still need updating. See why field IDs make rename safe.
Why did my re-added column come back empty? Because the re-added column has a new field ID, so historical rows read as null for it. See what breaks when you drop and re-add.
Can I change a column from int to string? No. The spec permits int→long, float→double, and decimal precision widening only, and blocks promotion when a bucket partition source would hash differently. See unsupported and engine-dependent changes.
Is schema evolution the same as partition evolution? No. Both are metadata operations, but schema evolution changes columns while partition evolution changes the layout new data is written under; old files keep their original layout.
Where Schema Evolution Fits in a Governed Lakehouse
Metadata-only evolution is only as safe as the catalog and engine layer that enforces field-ID semantics, partition-spec bindings, and access controls across every consumer — a rename that one engine honors and another ignores is a governance gap, not a format gap. That enforcement layer is where a platform such as Singdata's Iceberg-based lakehouse performs its part, and it is the layer to test when you validate a change against your own workloads rather than against a vendor claim.
For the authoritative text on every rule cited here, start with the Apache Iceberg evolution reference and the table specification.
jackey.ye · updated 2026-12-01