You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add update_column_doc to UpdateSchemaAction (changing a column doc shouldn't reassign its field ID) #2742
Is your feature request related to a problem or challenge?
UpdateSchemaAction currently only supports add_column and delete_column. There is no way to change just the documentation string (doc) of an existing column.
To change a column's doc today, the only option is to delete and re-add the column. That assigns a fresh field ID to the "new" column (add_column always allocates a new id from last_column_id). Since Iceberg identifies columns by field ID, changing the id breaks reads of older data files written under the old id (the column projects as all-NULL) and severs the column's schema-evolution history. So a harmless "edit the comment" operation silently corrupts data.
Describe the solution you'd like
Add UpdateSchemaAction::update_column_doc, mirroring iceberg-java's UpdateSchema.updateColumnDoc(String name, String newDoc), which updates only the doc and preserves the field ID and every other attribute.
tx.update_schema().update_column_doc("z",Some("the z column".to_string()))// set/replace.update_column_doc("person.name",Some("full name".to_string()))// nested via dotted path.update_column_doc("legacy",None);// clear the doc
Some(doc) sets/replaces the doc; None clears it. This is the Option<String> equivalent of Java's String + null argument.
Nested fields are addressed by dotted path (e.g. "address.city"), consistent with delete_column.
The column must exist in the current schema at commit time, otherwise the commit fails with DataInvalid/PreconditionFailed.
Thanks for the pointer @TwinklerG — confirmed, #2451 covers this (UpdateColumn::new_doc, applied via UpdateColumnOperation::Doc in schema_update, with a dedicated update_doc_preserves_other_metadata test). It's part of a much larger UpdateSchemaAction refactor there (required/optional toggle, type promotion, doc, default value, column move), so it supersedes this narrower PR rather than just overlapping it.
Activity
TwinklerG commentedon Jul 3, 2026
The feature has already been implemented in #2451.
viirya commentedon Jul 3, 2026
Thanks for the pointer @TwinklerG — confirmed, #2451 covers this (
UpdateColumn::new_doc, applied viaUpdateColumnOperation::Docinschema_update, with a dedicatedupdate_doc_preserves_other_metadatatest). It's part of a much largerUpdateSchemaActionrefactor there (required/optional toggle, type promotion, doc, default value, column move), so it supersedes this narrower PR rather than just overlapping it.Closing #2743 in favor of #2451.