Help Center/ MapReduce Service/ Component Operation Guide (LTS)/ Using Iceberg (Versions Earlier Than MRS 3.6.0.1)/ Functions and Table Configurations Supported by Iceberg/ Default Values for Iceberg Columns
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;
Parent topic: Functions and Table Configurations Supported by Iceberg
What is your overall rating for this page?
0
1
2
3
4
5
6
7
8
9
10
Very dissatisfiedVery satisfied
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.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot