From 20227c789f4950cc69e63fa8937884e6723c350b Mon Sep 17 00:00:00 2001 From: Yuya Ebihara Date: Wed, 15 Jan 2025 18:16:52 +0900 Subject: [PATCH] Update Iceberg version to 1.8.0 --- .../java/io/trino/plugin/iceberg/IcebergFileFormat.java | 1 + .../main/java/io/trino/plugin/iceberg/PartitionData.java | 2 ++ .../main/java/io/trino/plugin/iceberg/TypeConverter.java | 3 +++ .../io/trino/plugin/iceberg/util/HiveSchemaUtil.java | 2 ++ .../io/trino/plugin/iceberg/util/OrcTypeConverter.java | 2 ++ pom.xml | 9 ++++++++- 6 files changed, 18 insertions(+), 1 deletion(-) diff --git a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergFileFormat.java b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergFileFormat.java index 26f74b65ac2e..14a42180a946 100644 --- a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergFileFormat.java +++ b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/IcebergFileFormat.java @@ -39,6 +39,7 @@ public static IcebergFileFormat fromIceberg(FileFormat format) case AVRO -> AVRO; // Not used as a data file format case METADATA -> throw new IllegalArgumentException("Unexpected METADATA file format"); + case PUFFIN -> throw new IllegalArgumentException("Unexpected PUFFIN file format"); }; } diff --git a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/PartitionData.java b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/PartitionData.java index 3b715b9e5efa..6bfb6a26748f 100644 --- a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/PartitionData.java +++ b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/PartitionData.java @@ -168,6 +168,8 @@ public static Object getValue(JsonNode partitionValue, Type type) createDecimalType(decimalType.precision(), decimalType.scale())); // TODO https://github.com/trinodb/trino/issues/19753 Support Iceberg timestamp types with nanosecond precision case TIMESTAMP_NANO: + // TODO https://github.com/trinodb/trino/issues/24538 Support variant type + case VARIANT: case LIST: case MAP: case STRUCT: diff --git a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/TypeConverter.java b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/TypeConverter.java index 7216a7463ba9..3863ec230b32 100644 --- a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/TypeConverter.java +++ b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/TypeConverter.java @@ -105,6 +105,9 @@ public static Type toTrinoType(org.apache.iceberg.types.Type type, TypeManager t return RowType.from(fields.stream() .map(field -> new RowType.Field(Optional.of(field.name()), toTrinoType(field.type(), typeManager))) .collect(toImmutableList())); + case VARIANT: + // TODO https://github.com/trinodb/trino/issues/24538 Support variant type + break; } throw new UnsupportedOperationException(format("Cannot convert from Iceberg type '%s' (%s) to Trino type", type, type.typeId())); } diff --git a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/util/HiveSchemaUtil.java b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/util/HiveSchemaUtil.java index 9a97255871fc..937aed78f527 100644 --- a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/util/HiveSchemaUtil.java +++ b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/util/HiveSchemaUtil.java @@ -52,6 +52,8 @@ private static String convertToTypeString(Type type) case STRUCT -> "struct<%s>".formatted(type.asStructType().fields().stream() .map(field -> "%s:%s".formatted(field.name(), convert(field.type()))) .collect(joining(","))); + // TODO https://github.com/trinodb/trino/issues/24538 Support variant type + case VARIANT -> throw new TrinoException(NOT_SUPPORTED, "Unsupported Iceberg type: VARIANT"); }; } } diff --git a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/util/OrcTypeConverter.java b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/util/OrcTypeConverter.java index 413adc95ab2b..c71e9a6425a1 100644 --- a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/util/OrcTypeConverter.java +++ b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/util/OrcTypeConverter.java @@ -85,6 +85,8 @@ private static List toOrcType(int nextFieldTypeIndex, Type type, Map throw new TrinoException(NOT_SUPPORTED, "Unsupported Iceberg type: VARIANT"); case STRUCT -> toOrcStructType(nextFieldTypeIndex, (StructType) type, attributes); case LIST -> toOrcListType(nextFieldTypeIndex, (ListType) type, attributes); case MAP -> toOrcMapType(nextFieldTypeIndex, (MapType) type, attributes); diff --git a/pom.xml b/pom.xml index f92830c9b173..04e47697852d 100644 --- a/pom.xml +++ b/pom.xml @@ -200,7 +200,7 @@ 4.5.4 1.45.3 5.3.2 - 1.7.1 + 1.8.0-SNAPSHOT 5.16.0 2.12.7 0.12.6 @@ -2418,6 +2418,13 @@ + + + apache-snapshots + https://repository.apache.org/content/repositories/snapshots + + +