Package org.apache.iceberg.schema
Class UnionByNameVisitor
- java.lang.Object
-
- org.apache.iceberg.schema.SchemaWithPartnerVisitor<java.lang.Integer,java.lang.Boolean>
-
- org.apache.iceberg.schema.UnionByNameVisitor
-
public class UnionByNameVisitor extends SchemaWithPartnerVisitor<java.lang.Integer,java.lang.Boolean>
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 anUpdateSchema
operation.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.iceberg.schema.SchemaWithPartnerVisitor
SchemaWithPartnerVisitor.PartnerAccessors<P>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Boolean
field(Types.NestedField field, java.lang.Integer partnerId, java.lang.Boolean isFieldMissing)
java.lang.Boolean
list(Types.ListType list, java.lang.Integer partnerId, java.lang.Boolean isElementMissing)
java.lang.Boolean
map(Types.MapType map, java.lang.Integer partnerId, java.lang.Boolean isKeyMissing, java.lang.Boolean isValueMissing)
java.lang.Boolean
primitive(Type.PrimitiveType primitive, java.lang.Integer partnerId)
java.lang.Boolean
struct(Types.StructType struct, java.lang.Integer partnerId, java.util.List<java.lang.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 Detail
-
visit
public static void visit(UpdateSchema api, Schema existingSchema, Schema newSchema)
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
public java.lang.Boolean struct(Types.StructType struct, java.lang.Integer partnerId, java.util.List<java.lang.Boolean> missingPositions)
- Overrides:
struct
in classSchemaWithPartnerVisitor<java.lang.Integer,java.lang.Boolean>
-
field
public java.lang.Boolean field(Types.NestedField field, java.lang.Integer partnerId, java.lang.Boolean isFieldMissing)
- Overrides:
field
in classSchemaWithPartnerVisitor<java.lang.Integer,java.lang.Boolean>
-
list
public java.lang.Boolean list(Types.ListType list, java.lang.Integer partnerId, java.lang.Boolean isElementMissing)
- Overrides:
list
in classSchemaWithPartnerVisitor<java.lang.Integer,java.lang.Boolean>
-
map
public java.lang.Boolean map(Types.MapType map, java.lang.Integer partnerId, java.lang.Boolean isKeyMissing, java.lang.Boolean isValueMissing)
- Overrides:
map
in classSchemaWithPartnerVisitor<java.lang.Integer,java.lang.Boolean>
-
primitive
public java.lang.Boolean primitive(Type.PrimitiveType primitive, java.lang.Integer partnerId)
- Overrides:
primitive
in classSchemaWithPartnerVisitor<java.lang.Integer,java.lang.Boolean>
-
-