Package org.apache.iceberg.types
Class CheckCompatibility
- java.lang.Object
-
- org.apache.iceberg.types.TypeUtil.CustomOrderSchemaVisitor<java.util.List<java.lang.String>>
-
- org.apache.iceberg.types.CheckCompatibility
-
public class CheckCompatibility extends TypeUtil.CustomOrderSchemaVisitor<java.util.List<java.lang.String>>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.lang.String>
field(Types.NestedField readField, java.util.function.Supplier<java.util.List<java.lang.String>> fieldErrors)
java.util.List<java.lang.String>
list(Types.ListType readList, java.util.function.Supplier<java.util.List<java.lang.String>> elementErrors)
java.util.List<java.lang.String>
map(Types.MapType readMap, java.util.function.Supplier<java.util.List<java.lang.String>> keyErrors, java.util.function.Supplier<java.util.List<java.lang.String>> valueErrors)
java.util.List<java.lang.String>
primitive(Type.PrimitiveType readPrimitive)
static java.util.List<java.lang.String>
readCompatibilityErrors(Schema readSchema, Schema writeSchema)
Returns a list of compatibility errors for reading with the given read schema.java.util.List<java.lang.String>
schema(Schema readSchema, java.util.function.Supplier<java.util.List<java.lang.String>> structErrors)
java.util.List<java.lang.String>
struct(Types.StructType readStruct, java.lang.Iterable<java.util.List<java.lang.String>> fieldErrorLists)
static java.util.List<java.lang.String>
typeCompatibilityErrors(Schema readSchema, Schema writeSchema)
Returns a list of compatibility errors for writing with the given write schema.static java.util.List<java.lang.String>
typeCompatibilityErrors(Schema readSchema, Schema writeSchema, boolean checkOrdering)
Returns a list of compatibility errors for writing with the given write schema.static java.util.List<java.lang.String>
writeCompatibilityErrors(Schema readSchema, Schema writeSchema)
Returns a list of compatibility errors for writing with the given write schema.static java.util.List<java.lang.String>
writeCompatibilityErrors(Schema readSchema, Schema writeSchema, boolean checkOrdering)
Returns a list of compatibility errors for writing with the given write schema.
-
-
-
Method Detail
-
writeCompatibilityErrors
public static java.util.List<java.lang.String> writeCompatibilityErrors(Schema readSchema, Schema writeSchema)
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 java.util.List<java.lang.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 java.util.List<java.lang.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
public static java.util.List<java.lang.String> typeCompatibilityErrors(Schema readSchema, Schema writeSchema)
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
public static java.util.List<java.lang.String> readCompatibilityErrors(Schema readSchema, Schema writeSchema)
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
public java.util.List<java.lang.String> schema(Schema readSchema, java.util.function.Supplier<java.util.List<java.lang.String>> structErrors)
- Overrides:
schema
in classTypeUtil.CustomOrderSchemaVisitor<java.util.List<java.lang.String>>
-
struct
public java.util.List<java.lang.String> struct(Types.StructType readStruct, java.lang.Iterable<java.util.List<java.lang.String>> fieldErrorLists)
- Overrides:
struct
in classTypeUtil.CustomOrderSchemaVisitor<java.util.List<java.lang.String>>
-
field
public java.util.List<java.lang.String> field(Types.NestedField readField, java.util.function.Supplier<java.util.List<java.lang.String>> fieldErrors)
- Overrides:
field
in classTypeUtil.CustomOrderSchemaVisitor<java.util.List<java.lang.String>>
-
list
public java.util.List<java.lang.String> list(Types.ListType readList, java.util.function.Supplier<java.util.List<java.lang.String>> elementErrors)
- Overrides:
list
in classTypeUtil.CustomOrderSchemaVisitor<java.util.List<java.lang.String>>
-
map
public java.util.List<java.lang.String> map(Types.MapType readMap, java.util.function.Supplier<java.util.List<java.lang.String>> keyErrors, java.util.function.Supplier<java.util.List<java.lang.String>> valueErrors)
- Overrides:
map
in classTypeUtil.CustomOrderSchemaVisitor<java.util.List<java.lang.String>>
-
primitive
public java.util.List<java.lang.String> primitive(Type.PrimitiveType readPrimitive)
- Overrides:
primitive
in classTypeUtil.CustomOrderSchemaVisitor<java.util.List<java.lang.String>>
-
-