Class EvolveSchemaVisitor
java.lang.Object
org.apache.iceberg.schema.SchemaWithPartnerVisitor<Integer,Boolean>
org.apache.iceberg.flink.sink.dynamic.EvolveSchemaVisitor
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
- Dropping columns
- Renaming columns
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.iceberg.schema.SchemaWithPartnerVisitor
SchemaWithPartnerVisitor.PartnerAccessors<P>
-
Method Summary
Modifier and TypeMethodDescriptionfield
(Types.NestedField field, Integer partnerId, Boolean isFieldMissing) list
(Types.ListType list, Integer partnerId, Boolean isElementMissing) map
(Types.MapType map, Integer partnerId, Boolean isKeyMissing, Boolean isValueMissing) primitive
(Type.PrimitiveType primitive, Integer partnerId) struct
(Types.StructType struct, Integer partnerId, List<Boolean> existingFields) static void
visit
(UpdateSchema api, Schema existingSchema, Schema targetSchema) Adds changes needed to produce the target schema to anUpdateSchema
operation.Methods inherited from class org.apache.iceberg.schema.SchemaWithPartnerVisitor
afterField, afterListElement, afterMapKey, afterMapValue, beforeField, beforeListElement, beforeMapKey, beforeMapValue, schema, variant, visit, visit
-
Method Details
-
visit
Adds changes needed to produce the target schema to anUpdateSchema
operation.Changes are accumulated to evolve the existingSchema into a targetSchema.
- Parameters:
api
- an UpdateSchema for adding changesexistingSchema
- an existing schematargetSchema
- a new schema to compare with the existing
-
struct
- Overrides:
struct
in classSchemaWithPartnerVisitor<Integer,
Boolean>
-
field
- Overrides:
field
in classSchemaWithPartnerVisitor<Integer,
Boolean>
-
list
- Overrides:
list
in classSchemaWithPartnerVisitor<Integer,
Boolean>
-
map
public Boolean map(Types.MapType map, Integer partnerId, Boolean isKeyMissing, Boolean isValueMissing) - Overrides:
map
in classSchemaWithPartnerVisitor<Integer,
Boolean>
-
primitive
- Overrides:
primitive
in classSchemaWithPartnerVisitor<Integer,
Boolean>
-