Class AvroSchemaUtil

java.lang.Object
org.apache.iceberg.avro.AvroSchemaUtil

public class AvroSchemaUtil extends Object
  • Field Details

  • Method Details

    • convert

      public static org.apache.avro.Schema convert(Schema schema, String tableName)
    • convert

      public static org.apache.avro.Schema convert(Schema schema, Map<Types.StructType,String> names)
    • convert

      public static org.apache.avro.Schema convert(Type type)
    • convert

      public static org.apache.avro.Schema convert(Types.StructType type, String name)
    • convert

      public static org.apache.avro.Schema convert(Type type, Map<Types.StructType,String> names)
    • convert

      public static org.apache.avro.Schema convert(Type type, BiFunction<Integer,Types.StructType,String> namesFunction)
    • convert

      public static Type convert(org.apache.avro.Schema schema)
    • toIceberg

      public static Schema toIceberg(org.apache.avro.Schema schema)
    • convertTypes

      public static Map<Type,org.apache.avro.Schema> convertTypes(Types.StructType type, String name)
    • pruneColumns

      public static org.apache.avro.Schema pruneColumns(org.apache.avro.Schema schema, Set<Integer> selectedIds)
    • pruneColumns

      @Deprecated public static org.apache.avro.Schema pruneColumns(org.apache.avro.Schema schema, Set<Integer> selectedIds, NameMapping nameMapping)
      Deprecated.
      will be removed in 2.0.0; use applyNameMapping and pruneColumns(Schema, Set) instead.
    • buildAvroProjection

      public static org.apache.avro.Schema buildAvroProjection(org.apache.avro.Schema schema, Schema expected, Map<String,String> renames)
    • applyNameMapping

      public static org.apache.avro.Schema applyNameMapping(org.apache.avro.Schema fileSchema, NameMapping nameMapping)
    • isTimestamptz

      public static boolean isTimestamptz(org.apache.avro.Schema schema)
    • isOptionSchema

      public static boolean isOptionSchema(org.apache.avro.Schema schema)
    • isKeyValueSchema

      public static boolean isKeyValueSchema(org.apache.avro.Schema schema)
    • getKeyId

      public static int getKeyId(org.apache.avro.Schema schema)
    • getValueId

      public static int getValueId(org.apache.avro.Schema schema)
    • getElementId

      public static int getElementId(org.apache.avro.Schema schema)
    • getFieldId

      public static int getFieldId(org.apache.avro.Schema.Field field)
    • hasFieldId

      public static boolean hasFieldId(org.apache.avro.Schema.Field field)
    • makeCompatibleName

      public static String makeCompatibleName(String name)