Package org.apache.iceberg.avro
Class AvroSchemaUtil
java.lang.Object
org.apache.iceberg.avro.AvroSchemaUtil
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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, Map<String, String> renames) static Type
convert
(org.apache.avro.Schema schema) static org.apache.avro.Schema
static org.apache.avro.Schema
convert
(Schema schema, Map<Types.StructType, String> names) static org.apache.avro.Schema
static org.apache.avro.Schema
convert
(Type type, BiFunction<Integer, Types.StructType, String> namesFunction) static org.apache.avro.Schema
convert
(Type type, Map<Types.StructType, String> names) static org.apache.avro.Schema
convert
(Types.StructType type, String name) convertTypes
(Types.StructType type, 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 String
makeCompatibleName
(String name) static org.apache.avro.Schema
pruneColumns
(org.apache.avro.Schema schema, Set<Integer> selectedIds) 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.static Schema
toIceberg
(org.apache.avro.Schema schema)
-
Field Details
-
ICEBERG_FIELD_NAME_PROP
- See Also:
-
FIELD_ID_PROP
- See Also:
-
KEY_ID_PROP
- See Also:
-
VALUE_ID_PROP
- See Also:
-
ELEMENT_ID_PROP
- See Also:
-
ADJUST_TO_UTC_PROP
- See Also:
-
-
Method Details
-
convert
-
convert
-
convert
-
convert
-
convert
-
convert
public static org.apache.avro.Schema convert(Type type, BiFunction<Integer, Types.StructType, String> namesFunction) -
convert
-
toIceberg
-
convertTypes
-
pruneColumns
-
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
-
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
-