Package org.apache.iceberg.schema
Class UnionByNameVisitor
java.lang.Object
org.apache.iceberg.schema.SchemaWithPartnerVisitor<Integer,Boolean>
org.apache.iceberg.schema.UnionByNameVisitor
Visitor class that accumulates the set of changes needed to evolve an existing schema into the
union of the existing and a new schema. Changes are added to an
UpdateSchema
operation.-
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> missingPositions) static void
visit
(UpdateSchema api, Schema existingSchema, Schema newSchema) Adds changes needed to produce a union of two schemas to anUpdateSchema
operation.static void
visit
(UpdateSchema api, Schema existingSchema, Schema newSchema, boolean caseSensitive) Adds changes needed to produce a union of two schemas to anUpdateSchema
operation.Methods inherited from class org.apache.iceberg.schema.SchemaWithPartnerVisitor
afterField, afterListElement, afterMapKey, afterMapValue, beforeField, beforeListElement, beforeMapKey, beforeMapValue, schema, visit, visit
-
Method Details
-
visit
Adds changes needed to produce a union of two schemas to anUpdateSchema
operation.Changes are accumulated to evolve the existingSchema into a union with newSchema.
- Parameters:
api
- an UpdateSchema for adding changesexistingSchema
- an existing schemanewSchema
- a new schema to compare with the existing
-
visit
public static void visit(UpdateSchema api, Schema existingSchema, Schema newSchema, boolean caseSensitive) Adds changes needed to produce a union of two schemas to anUpdateSchema
operation.Changes are accumulated to evolve the existingSchema into a union with newSchema.
- Parameters:
api
- an UpdateSchema for adding changesexistingSchema
- an existing schemacaseSensitive
- when false, the case of schema's fields are ignorednewSchema
- 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>
-