Class AvroSchemaUtil


  • public class AvroSchemaUtil
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static org.apache.avro.Schema applyNameMapping​(org.apache.avro.Schema fileSchema, NameMapping nameMapping)  
      static org.apache.avro.Schema buildAvroProjection​(org.apache.avro.Schema schema, Schema expected, java.util.Map<java.lang.String,​java.lang.String> renames)  
      static Type convert​(org.apache.avro.Schema schema)  
      static org.apache.avro.Schema convert​(Schema schema, java.lang.String tableName)  
      static org.apache.avro.Schema convert​(Schema schema, java.util.Map<Types.StructType,​java.lang.String> names)  
      static org.apache.avro.Schema convert​(Type type)  
      static org.apache.avro.Schema convert​(Type type, java.util.function.BiFunction<java.lang.Integer,​Types.StructType,​java.lang.String> namesFunction)  
      static org.apache.avro.Schema convert​(Type type, java.util.Map<Types.StructType,​java.lang.String> names)  
      static org.apache.avro.Schema convert​(Types.StructType type, java.lang.String name)  
      static java.util.Map<Type,​org.apache.avro.Schema> convertTypes​(Types.StructType type, java.lang.String name)  
      static int getElementId​(org.apache.avro.Schema schema)  
      static int getFieldId​(org.apache.avro.Schema.Field field)  
      static int getKeyId​(org.apache.avro.Schema schema)  
      static int getValueId​(org.apache.avro.Schema schema)  
      static boolean hasFieldId​(org.apache.avro.Schema.Field field)  
      static boolean isKeyValueSchema​(org.apache.avro.Schema schema)  
      static boolean isOptionSchema​(org.apache.avro.Schema schema)  
      static boolean isTimestamptz​(org.apache.avro.Schema schema)  
      static java.lang.String makeCompatibleName​(java.lang.String name)  
      static org.apache.avro.Schema pruneColumns​(org.apache.avro.Schema schema, java.util.Set<java.lang.Integer> selectedIds)  
      static org.apache.avro.Schema pruneColumns​(org.apache.avro.Schema schema, java.util.Set<java.lang.Integer> selectedIds, NameMapping nameMapping)
      Deprecated.
      will be removed in 2.0.0; use applyNameMapping and pruneColumns(Schema, Set) instead.
      static Schema toIceberg​(org.apache.avro.Schema schema)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • convert

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

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

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

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

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

        public static org.apache.avro.Schema convert​(Type type,
                                                     java.util.function.BiFunction<java.lang.Integer,​Types.StructType,​java.lang.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 java.util.Map<Type,​org.apache.avro.Schema> convertTypes​(Types.StructType type,
                                                                                    java.lang.String name)
      • pruneColumns

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

        @Deprecated
        public static org.apache.avro.Schema pruneColumns​(org.apache.avro.Schema schema,
                                                          java.util.Set<java.lang.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,
                                                                 java.util.Map<java.lang.String,​java.lang.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 java.lang.String makeCompatibleName​(java.lang.String name)