Skip to content

[lake/iceberg] Support ADD COLUMN schema evolution for Iceberg lake catalog #2592

@fresh-borzoni

Description

@fresh-borzoni

Search before asking

  • I searched in the issues and found nothing similar.

Motivation

PR #2189 added ADD COLUMN support for Paimon-enabled tables, including the server-side infrastructure (syncSchemaChangesToLake, idempotency checks). However, IcebergLakeCatalog.alterTable() still throws UnsupportedOperationException for schema changes.

When a user runs ALTER TABLE ADD COLUMN on a Fluss table with Iceberg datalake enabled, the schema change is applied to Fluss but not propagated to Iceberg, breaking lake queries.

This is the Iceberg counterpart of #2128 and a sub-task of #2067.

Solution

Implement AddColumn handling in IcebergLakeCatalog.alterTable() using Iceberg's UpdateSchema API, matching Paimon's constraints and idempotency pattern:

  • Use updateSchema.addColumn() + moveBefore(__bucket) to position new columns before system columns
  • 3-way schema compatibility check for crash recovery (same pattern as PaimonLakeCatalog)
  • Recursive type comparison ignoring Iceberg-assigned field IDs (needed because Iceberg reassigns field IDs during table creation, which breaks Type.equals() for complex types like Map/Array/Struct)
  • Same constraints as Paimon: nullable columns only, LAST position only

Anything else?

No response

Willingness to contribute

  • I'm willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions