Problem
TableSchema::apply_changes currently only handles SetOption / RemoveOption; all column-level SchemaChanges (add/rename/drop column, update column type/nullability/comment/position, update comment) return Unsupported. As a result FileSystemCatalog::alter_table cannot evolve a table's columns, and RESTCatalog::alter_table is entirely unimplemented.
In addition, the SchemaChange JSON does not match Java Paimon's wire format (Java uses an @JsonTypeInfo discriminator action with fieldNames arrays, newDataType/keepNullability, referenceFieldName, and FIRST/AFTER/BEFORE/LAST moves), so a REST alter_table could never interoperate with a Java server.
Proposal
- Implement all column-level changes in
apply_changes for top-level columns, mirroring Java SchemaManager.generateTableSchema (field-id allocation, move semantics, primary/partition-key guards).
- Align the
SchemaChange JSON wire format with Java Paimon.
- Add
AlterTableRequest + RESTApi::alter_table and implement RESTCatalog::alter_table.
Out of scope (follow-ups)
- Nested struct field paths (only top-level columns for now).
UpdateColumnType cast-compatibility validation (lenient replace for now).
- Java's
dropPrimaryKey / updateColumnDefaultValue variants.
Problem
TableSchema::apply_changescurrently only handlesSetOption/RemoveOption; all column-levelSchemaChanges (add/rename/drop column, update column type/nullability/comment/position, update comment) returnUnsupported. As a resultFileSystemCatalog::alter_tablecannot evolve a table's columns, andRESTCatalog::alter_tableis entirely unimplemented.In addition, the
SchemaChangeJSON does not match Java Paimon's wire format (Java uses an@JsonTypeInfodiscriminatoractionwithfieldNamesarrays,newDataType/keepNullability,referenceFieldName, and FIRST/AFTER/BEFORE/LAST moves), so a RESTalter_tablecould never interoperate with a Java server.Proposal
apply_changesfor top-level columns, mirroring JavaSchemaManager.generateTableSchema(field-id allocation, move semantics, primary/partition-key guards).SchemaChangeJSON wire format with Java Paimon.AlterTableRequest+RESTApi::alter_tableand implementRESTCatalog::alter_table.Out of scope (follow-ups)
UpdateColumnTypecast-compatibility validation (lenient replace for now).dropPrimaryKey/updateColumnDefaultValuevariants.