buvb opened a new pull request, #2189: URL: https://github.com/apache/fluss/pull/2189
### Purpose Linked issue: close #2128 This PR enables schema evolution for datalake-enabled tables, specifically supporting `ADD COLUMN ... LAST` with `NULLABLE` columns. When a user executes `ALTER TABLE ADD COLUMN` on a lake-enabled table, the schema change is first applied to Fluss (source of truth), then synchronized to Paimon. ### Brief change log - **CoordinatorService**: Pass `LakeCatalog` and `LakeCatalogContext` to [alterTableSchema()]for Paimon synchronization - **MetadataManager**: Add [syncSchemaChangesToLake()] to sync schema changes to Paimon after Fluss schema update; skip schema registration if schema unchanged (retry idempotency) - **SchemaUpdate**: Support idempotent [addColumn()] - if column already exists with same type and comment, treat as no-op - **PaimonLakeCatalog**: Handle `ColumnAlreadyExistException` as idempotent success for retry scenarios - **PaimonConversions**: Map Fluss `AddColumn` to Paimon `SchemaChange`, inserting new column before system columns - **FlussRecordAsPaimonRow**: Handle tiering transition period when Fluss record is wider than Paimon schema using `min(internalRow.getFieldCount(), businessFieldCount)` ### Tests - `LakeEnabledTableCreateITCase#testAlterLakeEnabledTableSchema` - Verify ADD COLUMN syncs to Paimon with correct type and comment - `FlussRecordAsPaimonRowTest#testFlussRecordWiderThanPaimonSchema` - Verify tiering doesn't crash when Fluss record has more fields than Paimon schema - `FlussRecordAsPaimonRowTest#testPaimonSchemaWiderThanFlussRecord` - Verify padding NULL for missing fields ### API and Format No API or storage format changes. ### Documentation No documentation changes required for this MVP. Future documentation may be needed when more schema evolution operations are supported. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
