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.
Willingness to contribute
I can contribute this independently.
Is your feature request related to a problem or challenge?
UpdateSchemaActioncurrently only supportsadd_columnanddelete_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_columnalways allocates a new id fromlast_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'sUpdateSchema.updateColumnDoc(String name, String newDoc), which updates only the doc and preserves the field ID and every other attribute.Some(doc)sets/replaces the doc;Noneclears it. This is theOption<String>equivalent of Java'sString+nullargument."address.city"), consistent withdelete_column.DataInvalid/PreconditionFailed.Willingness to contribute
I can contribute this independently.