Class CheckCompatibility

    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 schema
        writeSchema - 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 schema
        writeSchema - a write schema
        checkOrdering - 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. use writeCompatibilityErrors(Schema, Schema).
        Parameters:
        readSchema - a read schema
        writeSchema - a write schema
        checkOrdering - 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, use writeCompatibilityErrors(Schema, Schema).
        Parameters:
        readSchema - a read schema
        writeSchema - 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 schema
        writeSchema - 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 class TypeUtil.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 class TypeUtil.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 class TypeUtil.CustomOrderSchemaVisitor<java.util.List<java.lang.String>>