Package org.apache.iceberg.types
Class CheckCompatibility
java.lang.Object
org.apache.iceberg.types.TypeUtil.CustomOrderSchemaVisitor<List<String>>
org.apache.iceberg.types.CheckCompatibility
-
Method Summary
Modifier and TypeMethodDescriptionfield
(Types.NestedField readField, Supplier<List<String>> fieldErrors) list
(Types.ListType readList, Supplier<List<String>> elementErrors) primitive
(Type.PrimitiveType readPrimitive) readCompatibilityErrors
(Schema readSchema, Schema writeSchema) Returns a list of compatibility errors for reading with the given read schema.struct
(Types.StructType readStruct, Iterable<List<String>> fieldErrorLists) typeCompatibilityErrors
(Schema readSchema, Schema writeSchema) Returns a list of compatibility errors for writing with the given write schema.typeCompatibilityErrors
(Schema readSchema, Schema writeSchema, boolean checkOrdering) Returns a list of compatibility errors for writing with the given write schema.writeCompatibilityErrors
(Schema readSchema, Schema writeSchema) Returns a list of compatibility errors for writing with the given write schema.writeCompatibilityErrors
(Schema readSchema, Schema writeSchema, boolean checkOrdering) Returns a list of compatibility errors for writing with the given write schema.
-
Method Details
-
writeCompatibilityErrors
Returns a list of compatibility errors for writing with the given write schema. This includes nullability: writing optional (nullable) values to a required field is an error.- Parameters:
readSchema
- a read schemawriteSchema
- a write schema- Returns:
- a list of error details, or an empty list if there are no compatibility problems
-
writeCompatibilityErrors
public static List<String> writeCompatibilityErrors(Schema readSchema, Schema writeSchema, boolean checkOrdering) Returns a list of compatibility errors for writing with the given write schema. This includes nullability: writing optional (nullable) values to a required field is an error Optionally this method allows case where input schema has different ordering than table schema.- Parameters:
readSchema
- a read schemawriteSchema
- a write schemacheckOrdering
- If false, allow input schema to have different ordering than table schema- Returns:
- a list of error details, or an empty list if there are no compatibility problems
-
typeCompatibilityErrors
public static List<String> typeCompatibilityErrors(Schema readSchema, Schema writeSchema, boolean checkOrdering) Returns a list of compatibility errors for writing with the given write schema. This checks type compatibility and not nullability: writing optional (nullable) values to a required field is not an error. To check nullability as well as types, Optionally this method allows case where input schema has different ordering than table schema. usewriteCompatibilityErrors(Schema, Schema)
.- Parameters:
readSchema
- a read schemawriteSchema
- a write schemacheckOrdering
- If false, allow input schema to have different ordering than table schema- Returns:
- a list of error details, or an empty list if there are no compatibility problems
-
typeCompatibilityErrors
Returns a list of compatibility errors for writing with the given write schema. This checks type compatibility and not nullability: writing optional (nullable) values to a required field is not an error. To check nullability as well as types, usewriteCompatibilityErrors(Schema, Schema)
.- Parameters:
readSchema
- a read schemawriteSchema
- a write schema- Returns:
- a list of error details, or an empty list if there are no compatibility problems
-
readCompatibilityErrors
Returns a list of compatibility errors for reading with the given read schema.- Parameters:
readSchema
- a read schemawriteSchema
- a write schema- Returns:
- a list of error details, or an empty list if there are no compatibility problems
-
schema
- Overrides:
schema
in classTypeUtil.CustomOrderSchemaVisitor<List<String>>
-
struct
- Overrides:
struct
in classTypeUtil.CustomOrderSchemaVisitor<List<String>>
-
field
- Overrides:
field
in classTypeUtil.CustomOrderSchemaVisitor<List<String>>
-
list
- Overrides:
list
in classTypeUtil.CustomOrderSchemaVisitor<List<String>>
-
map
public List<String> map(Types.MapType readMap, Supplier<List<String>> keyErrors, Supplier<List<String>> valueErrors) - Overrides:
map
in classTypeUtil.CustomOrderSchemaVisitor<List<String>>
-
primitive
- Overrides:
primitive
in classTypeUtil.CustomOrderSchemaVisitor<List<String>>
-