Schema Evolution of Iceberg Tables
Iceberg supports in-place table evolution. You can evolve a table schema simply by modifying the metadata, without the need to create a table or rewrite data.
Schema Evolution
Iceberg supports the following schema evolution changes:
- Add: Add a new column to the table or to a nested structure.
- Drop: Remove an existing column from the table or a nested structure.
- Rename: Rename an existing column or field in a nested structure.
- Update: Widen the type of a column, structure field, map key, map value, or list element. Note that map keys do not support adding or dropping structure fields that would change equality.
- Reorder: Change the order of columns or fields in a nested structure.
Iceberg schema updates are metadata changes, so no data files need to be rewritten to perform the update.
Evolution Scope Supported by Data Types
- Table 1 lists the evolution scope supported by primitive data types.
Table 1 Evolution scope supported by primitive data types Primitive Type
v1 and v2 Valid Type Promotion
Requirements
unknown
-
-
int
long
-
date
-
Promotion to timestamptz or timestamptz_ns is not allowed. Values outside the promoted type's range will result in a runtime failure.
float
double
-
decimal(P, S)
decimal(P', S) (P' > P)
Enhance precision only.
- The evolution scope supported by the struct type is as follows:
- Delete a field from a struct.
- Add a field to a struct.
- Rename a field in a struct.
- Reorder fields in a struct.
- Evolve the fields in a struct (for details, see Table 1).
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot