Updated on 2026-11-06 GMT+08:00

Paimon Table Schema Evolution

Paimon 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 is a metadata-level change, so no data files need to be rewritten to perform the update.

Schema Evolution

Paimon supports the following schema evolution changes:

  • Adding a column: Adds a column to a table. The new column is assigned a unique field ID.
  • Deleting a column: Removes an existing column from a table. Its field ID will not be reused.
  • Renaming a column: Changes the name of an existing column. The field ID remains unchanged.
  • Modifying the column order: Adjusts the position of a column in the table.
  • Changing the type: Supports upgrading from a lower-precision type to a higher-precision type, such as from INT to BIGINT or from FLOAT to DOUBLE.

    Paimon uses field IDs to ensure data compatibility after schema evolution. Each field is assigned a unique integer ID when it is created. This ID is written into the schema of the data file. When reading a data file, the field IDs are used to map the columns in the metadata to the columns in the file. Any change in the column name or type will not affect the reading of the historical data file.

Evolution Scope Supported by Data Types

  • Basic data types:
    • INT can be upgraded to BIGINT.
    • FLOAT can be upgraded to DOUBLE.
    • DECIMAL(P, S) can be upgraded to DECIMAL(P', S) (P' > P) to increase the precision.
  • Struct type
    • 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 field type in a struct (following the rules for basic data types).
  • List type
    • Add a new element field to a list (only when the element is of the struct type).
    • Delete an element field from a list (only when the element is of the struct type).
    • Rename an element field in a list (only when the element is of the struct type).
    • Evolve the element type in a list (following the rules for basic data types).
  • Map type
    • Add a new value field to a map (only when the value is of the struct type).
    • Delete a value field from a map (only when the value is of the struct type).
    • Rename a value field in a map (only when the value is of the struct type).
    • Evolve the key or value type in a map (following the rules for basic data types). Note that map keys do not support adding or deleting struct fields that would change equality.