fluss
fluss copied to clipboard
[lake/lance] Support ADD COLUMN schema evolution for Lance lake catalog
Search before asking
- [x] I searched in the issues and found nothing similar.
Motivation
#2189 added ADD COLUMN support for Paimon-enabled tables, including the server-side lake sync, and #2592 extended it to Iceberg. Lance is the remaining lake format: LanceLakeCatalog#alterTable always throws UnsupportedOperationException("Alter table is not supported for Lance at the moment").
Since MetadataManager#alterTableSchema syncs schema changes to the lake before updating the Fluss schema, ALTER TABLE ... ADD COLUMN currently fails for any table with table.datalake.format = lance. ALTER TABLE ... SET for lake properties fails the same way.
Solution
- Implement
LanceLakeCatalog#alterTable:AddColumn→Dataset#addColumns(List<Field>), converting the field viaLanceArrowUtilsSetOption/ResetOption→Dataset#updateConfig/Dataset#deleteConfigKeys- reject other changes with a clear error
- Make retries safe like
IcebergLakeCatalog: skipAddColumnif the Lance schema already matches the expected Fluss schema. - Tests: a
LanceLakeCatalogunit test, plus an ITCase that tiers data, adds a column, tiers again, and verifies old rows read back with nulls.
Anything else?
No response
Willingness to contribute
- [x] I'm willing to submit a PR!