Package net.snowflake.ingest.utils
Class IcebergDataTypeParser
- java.lang.Object
-
- net.snowflake.ingest.utils.IcebergDataTypeParser
-
public class IcebergDataTypeParser extends Object
This class is used to Iceberg data type (include primitive types and nested types) serialization and deserialization.This code is modified from GlobalServices/modules/data-lake/datalake-api/src/main/java/com/snowflake/metadata/iceberg /IcebergDataTypeParser.java
-
-
Constructor Summary
Constructors Constructor Description IcebergDataTypeParser()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.apache.iceberg.types.TypedeserializeIcebergType(String icebergDataType)Get Iceberg data type information by deserialization.static org.apache.iceberg.types.TypegetTypeFromJson(com.fasterxml.jackson.databind.JsonNode jsonNode)Get corresponding Iceberg data type from JsonNode.static org.apache.iceberg.types.Types.ListTypelistFromJson(com.fasterxml.jackson.databind.JsonNode json)Get Iceberg list type information from JsonNode.static org.apache.iceberg.types.Types.MapTypemapFromJson(com.fasterxml.jackson.databind.JsonNode json)Get Iceberg map type from JsonNode.static org.apache.parquet.schema.TypeparseIcebergDataTypeStringToParquetType(String icebergDataType, org.apache.parquet.schema.Type.Repetition repetition, int id, String name)Get Iceberg data type information by deserialization.static org.apache.iceberg.types.Types.StructTypestructFromJson(com.fasterxml.jackson.databind.JsonNode json)Get Iceberg struct type information from JsonNode.
-
-
-
Method Detail
-
parseIcebergDataTypeStringToParquetType
public static org.apache.parquet.schema.Type parseIcebergDataTypeStringToParquetType(String icebergDataType, org.apache.parquet.schema.Type.Repetition repetition, int id, String name)
Get Iceberg data type information by deserialization.- Parameters:
icebergDataType- string representation of Iceberg data typerepetition- repetition of the Parquet data typeid- column idname- column name- Returns:
- Iceberg data type
-
deserializeIcebergType
public static org.apache.iceberg.types.Type deserializeIcebergType(String icebergDataType)
Get Iceberg data type information by deserialization.- Parameters:
icebergDataType- string representation of Iceberg data type- Returns:
- Iceberg data type
-
getTypeFromJson
public static org.apache.iceberg.types.Type getTypeFromJson(@Nonnull com.fasterxml.jackson.databind.JsonNode jsonNode)
Get corresponding Iceberg data type from JsonNode.- Parameters:
jsonNode- JsonNode parsed from Iceberg type string.- Returns:
- Iceberg data type
-
structFromJson
@Nonnull public static org.apache.iceberg.types.Types.StructType structFromJson(@Nonnull com.fasterxml.jackson.databind.JsonNode json)
Get Iceberg struct type information from JsonNode.- Parameters:
json- JsonNode parsed from Iceberg type string.- Returns:
- struct type
-
listFromJson
public static org.apache.iceberg.types.Types.ListType listFromJson(com.fasterxml.jackson.databind.JsonNode json)
Get Iceberg list type information from JsonNode.- Parameters:
json- JsonNode parsed from Iceberg type string.- Returns:
- list type
-
mapFromJson
public static org.apache.iceberg.types.Types.MapType mapFromJson(com.fasterxml.jackson.databind.JsonNode json)
Get Iceberg map type from JsonNode.- Parameters:
json- JsonNode parsed from Iceberg type string.- Returns:
- map type
-
-