Package org.apache.iceberg.avro
Class AvroSchemaUtil
- java.lang.Object
 - 
- org.apache.iceberg.avro.AvroSchemaUtil
 
 
- 
public class AvroSchemaUtil extends java.lang.Object 
- 
- 
Field Summary
Fields Modifier and Type Field Description static java.lang.StringADJUST_TO_UTC_PROPstatic java.lang.StringELEMENT_ID_PROPstatic java.lang.StringFIELD_ID_PROPstatic java.lang.StringICEBERG_FIELD_NAME_PROPstatic java.lang.StringKEY_ID_PROPstatic java.lang.StringVALUE_ID_PROP 
- 
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.apache.avro.SchemabuildAvroProjection(org.apache.avro.Schema schema, Schema expected, java.util.Map<java.lang.String,java.lang.String> renames)static Typeconvert(org.apache.avro.Schema schema)static org.apache.avro.Schemaconvert(Schema schema, java.lang.String tableName)static org.apache.avro.Schemaconvert(Schema schema, java.util.Map<Types.StructType,java.lang.String> names)static org.apache.avro.Schemaconvert(Type type)static org.apache.avro.Schemaconvert(Type type, java.util.Map<Types.StructType,java.lang.String> names)static org.apache.avro.Schemaconvert(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 intgetElementId(org.apache.avro.Schema schema)static intgetFieldId(org.apache.avro.Schema.Field field)static intgetKeyId(org.apache.avro.Schema schema)static intgetValueId(org.apache.avro.Schema schema)static booleanhasFieldId(org.apache.avro.Schema.Field field)static booleanisKeyValueSchema(org.apache.avro.Schema schema)static booleanisOptionSchema(org.apache.avro.Schema schema)static booleanisTimestamptz(org.apache.avro.Schema schema)static java.lang.StringmakeCompatibleName(java.lang.String name)static org.apache.avro.SchemapruneColumns(org.apache.avro.Schema schema, java.util.Set<java.lang.Integer> selectedIds, NameMapping nameMapping)static SchematoIceberg(org.apache.avro.Schema schema) 
 - 
 
- 
- 
Field Detail
- 
ICEBERG_FIELD_NAME_PROP
public static final java.lang.String ICEBERG_FIELD_NAME_PROP
- See Also:
 - Constant Field Values
 
 
- 
FIELD_ID_PROP
public static final java.lang.String FIELD_ID_PROP
- See Also:
 - Constant Field Values
 
 
- 
KEY_ID_PROP
public static final java.lang.String KEY_ID_PROP
- See Also:
 - Constant Field Values
 
 
- 
VALUE_ID_PROP
public static final java.lang.String VALUE_ID_PROP
- See Also:
 - Constant Field Values
 
 
- 
ELEMENT_ID_PROP
public static final java.lang.String ELEMENT_ID_PROP
- See Also:
 - Constant Field Values
 
 
- 
ADJUST_TO_UTC_PROP
public static final java.lang.String ADJUST_TO_UTC_PROP
- See Also:
 - Constant Field Values
 
 
 - 
 
- 
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 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, NameMapping nameMapping) 
- 
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) 
- 
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)
 
 - 
 
 -