Class EvolveSchemaVisitor

java.lang.Object
org.apache.iceberg.schema.SchemaWithPartnerVisitor<Integer,Boolean>
org.apache.iceberg.flink.sink.dynamic.EvolveSchemaVisitor

public class EvolveSchemaVisitor extends SchemaWithPartnerVisitor<Integer,Boolean>
Visitor class that accumulates the set of changes needed to evolve an existing schema into the target schema. Changes are applied to an UpdateSchema operation.

We support:

  • Adding new columns
  • Widening the type of existing columsn
  • Reordering columns
We don't support:
  • Dropping columns
  • Renaming columns
The reason is that dropping columns would create issues with late / out of order data. Once we drop fields, we wouldn't be able to easily add them back later without losing the associated data. Renaming columns is not supported because we compare schemas by name, which doesn't allow for renaming without additional hints.