diff --git a/plugin/trino-iceberg/pom.xml b/plugin/trino-iceberg/pom.xml index a4bff116e72b..d704ab5f689f 100644 --- a/plugin/trino-iceberg/pom.xml +++ b/plugin/trino-iceberg/pom.xml @@ -16,7 +16,7 @@ ${project.parent.basedir} - 0.71.0 + 0.76.0 @@ -239,12 +239,32 @@ org.projectnessie.nessie nessie-client ${dep.nessie.version} + + + com.fasterxml.jackson.core + jackson-annotations + + + com.fasterxml.jackson.core + jackson-databind + + org.projectnessie.nessie nessie-model ${dep.nessie.version} + + + com.fasterxml.jackson.core + jackson-annotations + + + com.fasterxml.jackson.core + jackson-databind + + @@ -344,14 +364,14 @@ org.apache.httpcomponents.client5 httpclient5 - 5.2.1 + 5.3 runtime org.apache.httpcomponents.core5 httpcore5 - 5.2.1 + 5.2.4 runtime diff --git a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/nessie/IcebergNessieCatalogModule.java b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/nessie/IcebergNessieCatalogModule.java index 7a2008dfc0c4..a80eb8a1125c 100644 --- a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/nessie/IcebergNessieCatalogModule.java +++ b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/nessie/IcebergNessieCatalogModule.java @@ -22,9 +22,9 @@ import io.trino.plugin.iceberg.catalog.IcebergTableOperationsProvider; import io.trino.plugin.iceberg.catalog.TrinoCatalogFactory; import org.apache.iceberg.nessie.NessieIcebergClient; +import org.projectnessie.client.NessieClientBuilder; import org.projectnessie.client.api.NessieApiV1; import org.projectnessie.client.auth.BearerAuthenticationProvider; -import org.projectnessie.client.http.HttpClientBuilder; import static io.airlift.configuration.ConfigBinder.configBinder; import static java.lang.Math.toIntExact; @@ -47,7 +47,7 @@ protected void setup(Binder binder) @Singleton public static NessieIcebergClient createNessieIcebergClient(IcebergNessieCatalogConfig icebergNessieCatalogConfig) { - HttpClientBuilder builder = HttpClientBuilder.builder() + NessieClientBuilder builder = NessieClientBuilder.createClientBuilderFromSystemSettings() .withUri(icebergNessieCatalogConfig.getServerUri()) .withDisableCompression(!icebergNessieCatalogConfig.isCompressionEnabled()) .withReadTimeout(toIntExact(icebergNessieCatalogConfig.getReadTimeout().toMillis())) diff --git a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/nessie/IcebergNessieTableOperations.java b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/nessie/IcebergNessieTableOperations.java index 3fe3c5b33dc4..04d96f5c3d46 100644 --- a/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/nessie/IcebergNessieTableOperations.java +++ b/plugin/trino-iceberg/src/main/java/io/trino/plugin/iceberg/catalog/nessie/IcebergNessieTableOperations.java @@ -95,7 +95,7 @@ protected void refreshFromMetadataLocation(String newLocation) @Override protected String getRefreshedLocation(boolean invalidateCaches) { - table = nessieClient.table(toIdentifier(new SchemaTableName(database, tableName))); + table = (IcebergTable) nessieClient.fetchContent(toIdentifier(new SchemaTableName(database, tableName))); if (table == null) { throw new TableNotFoundException(getSchemaTableName()); @@ -109,7 +109,8 @@ protected void commitNewTable(TableMetadata metadata) { verify(version.isEmpty(), "commitNewTable called on a table which already exists"); try { - nessieClient.commitTable(null, metadata, writeNewMetadata(metadata, 0), table, toKey(new SchemaTableName(database, this.tableName))); + nessieClient.commitTable(null, metadata, writeNewMetadata(metadata, 0), table.getId(), + toKey(new SchemaTableName(database, this.tableName))); } catch (NessieNotFoundException e) { throw new TrinoException(ICEBERG_COMMIT_ERROR, format("Cannot commit: ref '%s' no longer exists", nessieClient.refName()), e); @@ -126,7 +127,8 @@ protected void commitToExistingTable(TableMetadata base, TableMetadata metadata) { verify(version.orElseThrow() >= 0, "commitToExistingTable called on a new table"); try { - nessieClient.commitTable(base, metadata, writeNewMetadata(metadata, version.getAsInt() + 1), table, toKey(new SchemaTableName(database, this.tableName))); + nessieClient.commitTable(base, metadata, writeNewMetadata(metadata, version.getAsInt() + 1), table.getId(), + toKey(new SchemaTableName(database, this.tableName))); } catch (NessieNotFoundException e) { throw new TrinoException(ICEBERG_COMMIT_ERROR, format("Cannot commit: ref '%s' no longer exists", nessieClient.refName()), e); diff --git a/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/catalog/nessie/TestTrinoNessieCatalog.java b/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/catalog/nessie/TestTrinoNessieCatalog.java index 8424be77c89d..8932e7ff255a 100644 --- a/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/catalog/nessie/TestTrinoNessieCatalog.java +++ b/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/catalog/nessie/TestTrinoNessieCatalog.java @@ -36,8 +36,8 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; import org.junit.jupiter.api.parallel.Execution; +import org.projectnessie.client.NessieClientBuilder; import org.projectnessie.client.api.NessieApiV1; -import org.projectnessie.client.http.HttpClientBuilder; import java.io.File; import java.io.IOException; @@ -94,7 +94,7 @@ protected TrinoCatalog createTrinoCatalog(boolean useUniqueTableLocations) TrinoFileSystemFactory fileSystemFactory = new HdfsFileSystemFactory(HDFS_ENVIRONMENT, HDFS_FILE_SYSTEM_STATS); IcebergNessieCatalogConfig icebergNessieCatalogConfig = new IcebergNessieCatalogConfig() .setServerUri(URI.create(nessieContainer.getRestApiUri())); - NessieApiV1 nessieApi = HttpClientBuilder.builder() + NessieApiV1 nessieApi = NessieClientBuilder.createClientBuilderFromSystemSettings() .withUri(nessieContainer.getRestApiUri()) .build(NessieApiV1.class); NessieIcebergClient nessieClient = new NessieIcebergClient(nessieApi, icebergNessieCatalogConfig.getDefaultReferenceName(), null, ImmutableMap.of()); @@ -118,7 +118,7 @@ public void testDefaultLocation() IcebergNessieCatalogConfig icebergNessieCatalogConfig = new IcebergNessieCatalogConfig() .setDefaultWarehouseDir(tmpDirectory.toAbsolutePath().toString()) .setServerUri(URI.create(nessieContainer.getRestApiUri())); - NessieApiV1 nessieApi = HttpClientBuilder.builder() + NessieApiV1 nessieApi = NessieClientBuilder.createClientBuilderFromSystemSettings() .withUri(nessieContainer.getRestApiUri()) .build(NessieApiV1.class); NessieIcebergClient nessieClient = new NessieIcebergClient(nessieApi, icebergNessieCatalogConfig.getDefaultReferenceName(), null, ImmutableMap.of()); diff --git a/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/containers/NessieContainer.java b/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/containers/NessieContainer.java index a50765d83c5b..9b3c41b5c4c1 100644 --- a/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/containers/NessieContainer.java +++ b/plugin/trino-iceberg/src/test/java/io/trino/plugin/iceberg/containers/NessieContainer.java @@ -28,7 +28,7 @@ public class NessieContainer { private static final Logger log = Logger.get(NessieContainer.class); - public static final String DEFAULT_IMAGE = "projectnessie/nessie:0.71.0"; + public static final String DEFAULT_IMAGE = "projectnessie/nessie:0.76.0"; public static final String DEFAULT_HOST_NAME = "nessie"; public static final String VERSION_STORE_TYPE = "INMEMORY"; diff --git a/pom.xml b/pom.xml index 43d1eec7f681..ea607b3bb507 100644 --- a/pom.xml +++ b/pom.xml @@ -185,7 +185,7 @@ 2.23.0 10.4.1 1.43.3 - 1.4.3 + 1.5.0-SNAPSHOT 5.14.0 2.12.6 0.12.3 @@ -2113,6 +2113,20 @@ + + + + false + + + true + + apache.snapshots + Apache Development Snapshot Repository + https://repository.apache.org/content/repositories/snapshots/ + + + diff --git a/testing/trino-product-tests-launcher/src/main/java/io/trino/tests/product/launcher/env/environment/EnvSinglenodeSparkIcebergNessie.java b/testing/trino-product-tests-launcher/src/main/java/io/trino/tests/product/launcher/env/environment/EnvSinglenodeSparkIcebergNessie.java index 4c3a9857083c..0d2f159d4322 100644 --- a/testing/trino-product-tests-launcher/src/main/java/io/trino/tests/product/launcher/env/environment/EnvSinglenodeSparkIcebergNessie.java +++ b/testing/trino-product-tests-launcher/src/main/java/io/trino/tests/product/launcher/env/environment/EnvSinglenodeSparkIcebergNessie.java @@ -37,7 +37,7 @@ public class EnvSinglenodeSparkIcebergNessie { private static final int SPARK_THRIFT_PORT = 10213; private static final int NESSIE_PORT = 19120; - private static final String NESSIE_VERSION = "0.71.0"; + private static final String NESSIE_VERSION = "0.76.0"; private static final String SPARK = "spark"; private final DockerFiles dockerFiles;