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

Default Values for Iceberg Columns

Scenarios of Column Default Values

  • initial-default is used to populate the field's value for all records that were written before the field was added to the schema.
  • write-default is used to populate the field's value for any records written after the field was added to the schema, if the writer does not supply the field's value.
  • If no column default value is used, both initial-default and write-default are null.

initial-default

When you run the ALTER TABLE...ADD COLUMN statement to add a column, you can use the DEFAULT clause to set the initial default value. For example:

ALTER TABLE users ADD COLUMN age INT DEFAULT 25;

write-default

  • When a new column is added, write-default is initialized to initial-default.
  • You can change write-default of each column. For example:
    ALTER TABLE users ALTER COLUMN age SET DEFAULT 30;