From 0e1ec8aa4c199329b4e2f545c20724c73985c4fa Mon Sep 17 00:00:00 2001 From: Tamas Mate Date: Wed, 20 Aug 2025 09:33:09 +0200 Subject: [PATCH 1/3] Fix createViewWithCustomMetadataLocation tests for cloudTest task This patch fixes the createViewWithCustomMetadataLocation tests for cloudTest tasks. The original test was generating temp directories internally, causing cloudTests to fail with BadRequestException instead of the expected ForbiddenException. Changes: - Switched to Hadoop's Path (Java Path removes slashes, e.g. s3://bucket/path -> s3:/bucket/path) - Made base classes abstract to avoid running them - Implemented createViewWithCustomMetadataLocation to allow passing a custom location Testing: - Verified locally --- ...estCatalogViewAwsIntegrationTestBase.java} | 10 +- ...tCatalogViewAzureIntegrationTestBase.java} | 10 +- ...estCatalogViewFileIntegrationTestBase.java | 11 +- ...estCatalogViewGcpIntegrationTestBase.java} | 10 +- ...PolarisRestCatalogViewIntegrationBase.java | 121 ++++++++++++------ .../service/it/RestCatalogViewAwsIT.java | 4 +- .../service/it/RestCatalogViewAzureIT.java | 4 +- .../service/it/RestCatalogViewGcpIT.java | 4 +- 8 files changed, 113 insertions(+), 61 deletions(-) rename integration-tests/src/main/java/org/apache/polaris/service/it/test/{PolarisRestCatalogViewAwsIntegrationTest.java => PolarisRestCatalogViewAwsIntegrationTestBase.java} (84%) rename integration-tests/src/main/java/org/apache/polaris/service/it/test/{PolarisRestCatalogViewAzureIntegrationTest.java => PolarisRestCatalogViewAzureIntegrationTestBase.java} (83%) rename integration-tests/src/main/java/org/apache/polaris/service/it/test/{PolarisRestCatalogViewGcpIntegrationTest.java => PolarisRestCatalogViewGcpIntegrationTestBase.java} (83%) diff --git a/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewAwsIntegrationTest.java b/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewAwsIntegrationTestBase.java similarity index 84% rename from integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewAwsIntegrationTest.java rename to integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewAwsIntegrationTestBase.java index 63471c92b4..ee8cfa56d5 100644 --- a/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewAwsIntegrationTest.java +++ b/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewAwsIntegrationTestBase.java @@ -21,12 +21,12 @@ import com.google.common.base.Strings; import java.util.List; import java.util.Optional; -import java.util.stream.Stream; +import org.apache.hadoop.fs.Path; import org.apache.polaris.core.admin.model.AwsStorageConfigInfo; import org.apache.polaris.core.admin.model.StorageConfigInfo; /** Runs PolarisRestCatalogViewIntegrationTest on AWS. */ -public class PolarisRestCatalogViewAwsIntegrationTest +public abstract class PolarisRestCatalogViewAwsIntegrationTestBase extends PolarisRestCatalogViewIntegrationBase { public static final String ROLE_ARN = Optional.ofNullable(System.getenv("INTEGRATION_TEST_ROLE_ARN")) // Backward compatibility @@ -38,12 +38,12 @@ protected StorageConfigInfo getStorageConfigInfo() { return AwsStorageConfigInfo.builder() .setRoleArn(ROLE_ARN) .setStorageType(StorageConfigInfo.StorageTypeEnum.S3) - .setAllowedLocations(List.of(BASE_LOCATION)) + .setAllowedLocations(List.of(new Path(BASE_LOCATION, POLARIS_IT_SUBDIR).toString())) .build(); } @Override - protected boolean shouldSkip() { - return Stream.of(BASE_LOCATION, ROLE_ARN).anyMatch(Strings::isNullOrEmpty); + protected String getCustomMetadataLocationDir() { + return new Path(BASE_LOCATION, POLARIS_IT_CUSTOM_SUBDIR).toString(); } } diff --git a/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewAzureIntegrationTest.java b/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewAzureIntegrationTestBase.java similarity index 83% rename from integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewAzureIntegrationTest.java rename to integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewAzureIntegrationTestBase.java index 9d2c4d84a2..e4293d288a 100644 --- a/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewAzureIntegrationTest.java +++ b/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewAzureIntegrationTestBase.java @@ -20,12 +20,12 @@ import com.google.common.base.Strings; import java.util.List; -import java.util.stream.Stream; +import org.apache.hadoop.fs.Path; import org.apache.polaris.core.admin.model.AzureStorageConfigInfo; import org.apache.polaris.core.admin.model.StorageConfigInfo; /** Runs PolarisRestCatalogViewIntegrationTest on Azure. */ -public class PolarisRestCatalogViewAzureIntegrationTest +public abstract class PolarisRestCatalogViewAzureIntegrationTestBase extends PolarisRestCatalogViewIntegrationBase { public static final String TENANT_ID = System.getenv("INTEGRATION_TEST_AZURE_TENANT_ID"); public static final String BASE_LOCATION = System.getenv("INTEGRATION_TEST_AZURE_PATH"); @@ -35,12 +35,12 @@ protected StorageConfigInfo getStorageConfigInfo() { return AzureStorageConfigInfo.builder() .setTenantId(TENANT_ID) .setStorageType(StorageConfigInfo.StorageTypeEnum.AZURE) - .setAllowedLocations(List.of(BASE_LOCATION)) + .setAllowedLocations(List.of(new Path(BASE_LOCATION, POLARIS_IT_SUBDIR).toString())) .build(); } @Override - protected boolean shouldSkip() { - return Stream.of(BASE_LOCATION, TENANT_ID).anyMatch(Strings::isNullOrEmpty); + protected String getCustomMetadataLocationDir() { + return new Path(BASE_LOCATION, POLARIS_IT_CUSTOM_SUBDIR).toString(); } } diff --git a/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewFileIntegrationTestBase.java b/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewFileIntegrationTestBase.java index 4b1ae904a1..839be275d8 100644 --- a/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewFileIntegrationTestBase.java +++ b/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewFileIntegrationTestBase.java @@ -23,12 +23,14 @@ import org.apache.polaris.core.admin.model.FileStorageConfigInfo; import org.apache.polaris.core.admin.model.StorageConfigInfo; import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.io.TempDir; /** Runs PolarisRestCatalogViewIntegrationTest on the local filesystem. */ public abstract class PolarisRestCatalogViewFileIntegrationTestBase extends PolarisRestCatalogViewIntegrationBase { static String baseLocation; + private Path tempDirForCustomMetadataLocation; @BeforeAll public static void setUp(@TempDir Path tempDir) { @@ -39,6 +41,11 @@ public static void setUp(@TempDir Path tempDir) { baseLocation = baseUri; } + @BeforeEach + public void setUpTempDirForCustomMetadata(@TempDir Path tempDir) { + this.tempDirForCustomMetadataLocation = tempDir; + } + @Override protected StorageConfigInfo getStorageConfigInfo() { return FileStorageConfigInfo.builder() @@ -48,7 +55,7 @@ protected StorageConfigInfo getStorageConfigInfo() { } @Override - protected boolean shouldSkip() { - return false; + protected String getCustomMetadataLocationDir() { + return Path.of(tempDirForCustomMetadataLocation.toUri().toString()).toString(); } } diff --git a/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewGcpIntegrationTest.java b/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewGcpIntegrationTestBase.java similarity index 83% rename from integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewGcpIntegrationTest.java rename to integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewGcpIntegrationTestBase.java index 3dea04e619..970dd09785 100644 --- a/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewGcpIntegrationTest.java +++ b/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewGcpIntegrationTestBase.java @@ -20,12 +20,12 @@ import com.google.common.base.Strings; import java.util.List; -import java.util.stream.Stream; +import org.apache.hadoop.fs.Path; import org.apache.polaris.core.admin.model.GcpStorageConfigInfo; import org.apache.polaris.core.admin.model.StorageConfigInfo; /** Runs PolarisRestCatalogViewIntegrationTest on GCP. */ -public class PolarisRestCatalogViewGcpIntegrationTest +public abstract class PolarisRestCatalogViewGcpIntegrationTestBase extends PolarisRestCatalogViewIntegrationBase { public static final String SERVICE_ACCOUNT = System.getenv("INTEGRATION_TEST_GCS_SERVICE_ACCOUNT"); @@ -36,12 +36,12 @@ protected StorageConfigInfo getStorageConfigInfo() { return GcpStorageConfigInfo.builder() .setGcsServiceAccount(SERVICE_ACCOUNT) .setStorageType(StorageConfigInfo.StorageTypeEnum.GCS) - .setAllowedLocations(List.of(BASE_LOCATION)) + .setAllowedLocations(List.of(new Path(BASE_LOCATION, POLARIS_IT_SUBDIR).toString())) .build(); } @Override - protected boolean shouldSkip() { - return Stream.of(BASE_LOCATION, SERVICE_ACCOUNT).anyMatch(Strings::isNullOrEmpty); + protected String getCustomMetadataLocationDir() { + return new Path(BASE_LOCATION, POLARIS_IT_CUSTOM_SUBDIR).toString(); } } diff --git a/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewIntegrationBase.java b/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewIntegrationBase.java index 8cf61a5c44..b298a4c5e2 100644 --- a/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewIntegrationBase.java +++ b/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewIntegrationBase.java @@ -22,14 +22,14 @@ import com.google.common.collect.ImmutableMap; import java.lang.reflect.Method; -import java.nio.file.Path; -import java.nio.file.Paths; import java.util.Map; +import org.apache.hadoop.fs.Path; import org.apache.iceberg.catalog.TableIdentifier; import org.apache.iceberg.exceptions.ForbiddenException; import org.apache.iceberg.rest.RESTCatalog; import org.apache.iceberg.view.BaseView; import org.apache.iceberg.view.View; +import org.apache.iceberg.view.ViewBuilder; import org.apache.iceberg.view.ViewCatalogTests; import org.apache.polaris.core.admin.model.Catalog; import org.apache.polaris.core.admin.model.CatalogProperties; @@ -45,6 +45,8 @@ import org.apache.polaris.service.it.env.PolarisApiEndpoints; import org.apache.polaris.service.it.env.PolarisClient; import org.apache.polaris.service.it.ext.PolarisIntegrationTestExtension; +import org.assertj.core.api.AbstractBooleanAssert; +import org.assertj.core.api.AbstractStringAssert; import org.assertj.core.api.Assertions; import org.assertj.core.api.Assumptions; import org.assertj.core.configuration.PreferredAssumptionException; @@ -55,7 +57,6 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInfo; import org.junit.jupiter.api.extension.ExtendWith; -import org.junit.jupiter.api.io.TempDir; /** * Import the full core Iceberg catalog tests by hitting the REST service via the RESTCatalog @@ -86,6 +87,8 @@ public abstract class PolarisRestCatalogViewIntegrationBase extends ViewCatalogT private static PolarisApiEndpoints endpoints; private static PolarisClient client; private static ManagementApi managementApi; + protected static final String POLARIS_IT_SUBDIR = "polaris_it"; + protected static final String POLARIS_IT_CUSTOM_SUBDIR = "polaris_it_custom"; private RESTCatalog restCatalog; @@ -104,8 +107,6 @@ static void close() throws Exception { @BeforeEach public void before(TestInfo testInfo) { - Assumptions.assumeThat(shouldSkip()).isFalse(); - String principalName = client.newEntityName("snowman-rest"); String principalRoleName = client.newEntityName("rest-admin"); PrincipalWithCredentials principalCredentials = @@ -157,12 +158,6 @@ public void cleanUp() { */ protected abstract StorageConfigInfo getStorageConfigInfo(); - /** - * @return Whether the tests should be skipped, for example due to environment variables not being - * specified. - */ - protected abstract boolean shouldSkip(); - @Override protected RESTCatalog catalog() { return restCatalog; @@ -188,33 +183,84 @@ protected boolean overridesRequestedLocation() { return true; } - @Override + protected String getCustomMetadataLocationDir() { + return ""; + } + @Test + @Override public void createViewWithCustomMetadataLocation() { - Assertions.assertThatThrownBy(super::createViewWithCustomMetadataLocation) + TableIdentifier identifier = TableIdentifier.of("ns", "view"); + String baseLocation = catalog().properties().get(CatalogEntity.DEFAULT_BASE_LOCATION_KEY); + if (this.requiresNamespaceCreate()) { + // Use the default baseLocation of the catalog. No "write.metadata.path" set. + catalog().createNamespace(identifier.namespace()); + } + + // Negative test, we cannot create views outside of base location + ((AbstractBooleanAssert) + Assertions.assertThat(this.catalog().viewExists(identifier)) + .as("View should not exist", new Object[0])) + .isFalse(); + ViewBuilder viewBuilder = + catalog() + .buildView(identifier) + .withSchema(SCHEMA) + .withDefaultNamespace(identifier.namespace()) + .withDefaultCatalog(catalog().name()) + .withQuery("spark", "select * from ns.tbl") + .withProperty( + IcebergTableLikeEntity.USER_SPECIFIED_WRITE_METADATA_LOCATION_KEY, + getCustomMetadataLocationDir()) + .withLocation(baseLocation); + Assertions.assertThatThrownBy(viewBuilder::create) .isInstanceOf(ForbiddenException.class) .hasMessageContaining("Forbidden: Invalid locations"); + + // Positive, we can create views in the default base location's subdirectory + String baseViewLocation = catalog().properties().get(CatalogEntity.DEFAULT_BASE_LOCATION_KEY); + String baseCustomWriteMetadataLocation = baseViewLocation + "/custom_location"; + View view = + this.catalog() + .buildView(identifier) + .withSchema(SCHEMA) + .withDefaultNamespace(identifier.namespace()) + .withDefaultCatalog(this.catalog().name()) + .withQuery("spark", "select * from ns.tbl") + .withProperty("write.metadata.path", baseCustomWriteMetadataLocation) + .withLocation(baseViewLocation) + .create(); + Assertions.assertThat(view).isNotNull(); + ((AbstractBooleanAssert) + Assertions.assertThat(this.catalog().viewExists(identifier)) + .as("View should exist", new Object[0])) + .isTrue(); + Assertions.assertThat(view.properties()) + .containsEntry("write.metadata.path", baseCustomWriteMetadataLocation); + ((AbstractStringAssert) + Assertions.assertThat(((BaseView) view).operations().current().metadataFileLocation()) + .isNotNull()) + .startsWith(new Path(baseCustomWriteMetadataLocation).toString()); } @Test - public void createViewWithCustomMetadataLocationUsingPolaris(@TempDir Path tempDir) { + public void createViewWithCustomMetadataLocationInheritedFromNamespace() { TableIdentifier identifier = TableIdentifier.of("ns", "view"); - - String location = Paths.get(tempDir.toUri().toString()).toString(); - String customLocation = Paths.get(tempDir.toUri().toString(), "custom-location").toString(); - String customLocation2 = Paths.get(tempDir.toUri().toString(), "custom-location2").toString(); - String customLocationChild = - Paths.get(tempDir.toUri().toString(), "custom-location/child").toString(); - - catalog() - .createNamespace( - identifier.namespace(), - ImmutableMap.of( - IcebergTableLikeEntity.USER_SPECIFIED_WRITE_METADATA_LOCATION_KEY, location)); - + String viewBaseLocation = getCustomMetadataLocationDir(); + String customWriteMetadataLocation = viewBaseLocation + "/custom-location"; + String customWriteMetadataLocation2 = viewBaseLocation + "/custom-location2"; + String customWriteMetadataLocationChild = viewBaseLocation + "/custom-location/child"; + if (this.requiresNamespaceCreate()) { + // Views can inherit the namespace's "write.metadata.path" setting in Polaris. + catalog() + .createNamespace( + identifier.namespace(), + ImmutableMap.of( + IcebergTableLikeEntity.USER_SPECIFIED_WRITE_METADATA_LOCATION_KEY, + viewBaseLocation)); + } Assertions.assertThat(catalog().viewExists(identifier)).as("View should not exist").isFalse(); - - // CAN create a view with a custom metadata location `baseLocation/customLocation`, + // CAN create a view with a custom metadata location `viewLocation/customLocation`, // as long as the location is within the parent namespace's `write.metadata.path=baseLocation` View view = catalog() @@ -224,17 +270,17 @@ public void createViewWithCustomMetadataLocationUsingPolaris(@TempDir Path tempD .withDefaultCatalog(catalog().name()) .withQuery("spark", "select * from ns.tbl") .withProperty( - IcebergTableLikeEntity.USER_SPECIFIED_WRITE_METADATA_LOCATION_KEY, customLocation) - .withLocation(location) + IcebergTableLikeEntity.USER_SPECIFIED_WRITE_METADATA_LOCATION_KEY, + customWriteMetadataLocation) + .withLocation(viewBaseLocation) .create(); - Assertions.assertThat(view).isNotNull(); Assertions.assertThat(catalog().viewExists(identifier)).as("View should exist").isTrue(); - Assertions.assertThat(view.properties()).containsEntry("write.metadata.path", customLocation); + Assertions.assertThat(view.properties()) + .containsEntry("write.metadata.path", customWriteMetadataLocation); Assertions.assertThat(((BaseView) view).operations().current().metadataFileLocation()) .isNotNull() - .startsWith(customLocation); - + .startsWith(customWriteMetadataLocation); // CANNOT update the view with a new metadata location `baseLocation/customLocation2`, // even though the new location is still under the parent namespace's // `write.metadata.path=baseLocation`. @@ -245,11 +291,10 @@ public void createViewWithCustomMetadataLocationUsingPolaris(@TempDir Path tempD .updateProperties() .set( IcebergTableLikeEntity.USER_SPECIFIED_WRITE_METADATA_LOCATION_KEY, - customLocation2) + customWriteMetadataLocation2) .commit()) .isInstanceOf(ForbiddenException.class) .hasMessageContaining("Forbidden: Invalid locations"); - // CANNOT update the view with a child metadata location `baseLocation/customLocation/child`, // even though it is a subpath of the original view's // `write.metadata.path=baseLocation/customLocation`. @@ -260,7 +305,7 @@ public void createViewWithCustomMetadataLocationUsingPolaris(@TempDir Path tempD .updateProperties() .set( IcebergTableLikeEntity.USER_SPECIFIED_WRITE_METADATA_LOCATION_KEY, - customLocationChild) + customWriteMetadataLocationChild) .commit()) .isInstanceOf(ForbiddenException.class) .hasMessageContaining("Forbidden: Invalid locations"); diff --git a/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogViewAwsIT.java b/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogViewAwsIT.java index de6cfb387e..cf58078154 100644 --- a/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogViewAwsIT.java +++ b/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogViewAwsIT.java @@ -22,14 +22,14 @@ import java.lang.reflect.Field; import java.nio.file.Path; import org.apache.iceberg.view.ViewCatalogTests; -import org.apache.polaris.service.it.test.PolarisRestCatalogViewAwsIntegrationTest; +import org.apache.polaris.service.it.test.PolarisRestCatalogViewAwsIntegrationTestBase; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable; import org.junit.jupiter.api.io.TempDir; @QuarkusIntegrationTest @EnabledIfEnvironmentVariable(named = "INTEGRATION_TEST_S3_PATH", matches = ".+") -public class RestCatalogViewAwsIT extends PolarisRestCatalogViewAwsIntegrationTest { +public class RestCatalogViewAwsIT extends PolarisRestCatalogViewAwsIntegrationTestBase { @BeforeEach public void setUpTempDir(@TempDir Path tempDir) throws Exception { diff --git a/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogViewAzureIT.java b/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogViewAzureIT.java index 38a83c83fa..b73255d75c 100644 --- a/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogViewAzureIT.java +++ b/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogViewAzureIT.java @@ -22,14 +22,14 @@ import java.lang.reflect.Field; import java.nio.file.Path; import org.apache.iceberg.view.ViewCatalogTests; -import org.apache.polaris.service.it.test.PolarisRestCatalogViewAzureIntegrationTest; +import org.apache.polaris.service.it.test.PolarisRestCatalogViewAzureIntegrationTestBase; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable; import org.junit.jupiter.api.io.TempDir; @QuarkusIntegrationTest @EnabledIfEnvironmentVariable(named = "INTEGRATION_TEST_AZURE_PATH", matches = ".+") -public class RestCatalogViewAzureIT extends PolarisRestCatalogViewAzureIntegrationTest { +public class RestCatalogViewAzureIT extends PolarisRestCatalogViewAzureIntegrationTestBase { @BeforeEach public void setUpTempDir(@TempDir Path tempDir) throws Exception { diff --git a/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogViewGcpIT.java b/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogViewGcpIT.java index 1eca3ecc32..751ceddfdc 100644 --- a/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogViewGcpIT.java +++ b/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogViewGcpIT.java @@ -22,14 +22,14 @@ import java.lang.reflect.Field; import java.nio.file.Path; import org.apache.iceberg.view.ViewCatalogTests; -import org.apache.polaris.service.it.test.PolarisRestCatalogViewGcpIntegrationTest; +import org.apache.polaris.service.it.test.PolarisRestCatalogViewGcpIntegrationTestBase; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable; import org.junit.jupiter.api.io.TempDir; @QuarkusIntegrationTest @EnabledIfEnvironmentVariable(named = "INTEGRATION_TEST_GCS_PATH", matches = ".+") -public class RestCatalogViewGcpIT extends PolarisRestCatalogViewGcpIntegrationTest { +public class RestCatalogViewGcpIT extends PolarisRestCatalogViewGcpIntegrationTestBase { @BeforeEach public void setUpTempDir(@TempDir Path tempDir) throws Exception { From f17efa604e5dc8062bddc5dba07e69c0b63e5449 Mon Sep 17 00:00:00 2001 From: Tamas Mate Date: Sun, 24 Aug 2025 20:18:36 +0200 Subject: [PATCH 2/3] Addressing review comments, rebase --- ...larisRestCatalogAdlsIntegrationTestBase.java} | 6 +++--- ...olarisRestCatalogGcsIntegrationTestBase.java} | 2 +- ...PolarisRestCatalogS3IntegrationTestBase.java} | 2 +- ...sRestCatalogViewAdlsIntegrationTestBase.java} | 11 +++++++---- ...isRestCatalogViewGcsIntegrationTestBase.java} | 7 +++++-- .../PolarisRestCatalogViewIntegrationBase.java | 16 ++++++++++------ ...risRestCatalogViewS3IntegrationTestBase.java} | 7 +++++-- runtime/service/README.md | 6 +++--- ...atalogAzureIT.java => RestCatalogAdlsIT.java} | 6 +++--- ...stCatalogGcpIT.java => RestCatalogGcsIT.java} | 4 ++-- ...estCatalogAwsIT.java => RestCatalogS3IT.java} | 4 ++-- ...ewAzureIT.java => RestCatalogViewAdlsIT.java} | 6 +++--- ...gViewGcpIT.java => RestCatalogViewGcsIT.java} | 4 ++-- ...ogViewAwsIT.java => RestCatalogViewS3IT.java} | 4 ++-- 14 files changed, 49 insertions(+), 36 deletions(-) rename integration-tests/src/main/java/org/apache/polaris/service/it/test/{PolarisRestCatalogAzureIntegrationTestBase.java => PolarisRestCatalogAdlsIntegrationTestBase.java} (92%) rename integration-tests/src/main/java/org/apache/polaris/service/it/test/{PolarisRestCatalogGcpIntegrationTestBase.java => PolarisRestCatalogGcsIntegrationTestBase.java} (96%) rename integration-tests/src/main/java/org/apache/polaris/service/it/test/{PolarisRestCatalogAwsIntegrationTestBase.java => PolarisRestCatalogS3IntegrationTestBase.java} (96%) rename integration-tests/src/main/java/org/apache/polaris/service/it/test/{PolarisRestCatalogViewAzureIntegrationTestBase.java => PolarisRestCatalogViewAdlsIntegrationTestBase.java} (83%) rename integration-tests/src/main/java/org/apache/polaris/service/it/test/{PolarisRestCatalogViewGcpIntegrationTestBase.java => PolarisRestCatalogViewGcsIntegrationTestBase.java} (86%) rename integration-tests/src/main/java/org/apache/polaris/service/it/test/{PolarisRestCatalogViewAwsIntegrationTestBase.java => PolarisRestCatalogViewS3IntegrationTestBase.java} (87%) rename runtime/service/src/cloudTest/java/org/apache/polaris/service/it/{RestCatalogAzureIT.java => RestCatalogAdlsIT.java} (79%) rename runtime/service/src/cloudTest/java/org/apache/polaris/service/it/{RestCatalogGcpIT.java => RestCatalogGcsIT.java} (89%) rename runtime/service/src/cloudTest/java/org/apache/polaris/service/it/{RestCatalogAwsIT.java => RestCatalogS3IT.java} (86%) rename runtime/service/src/cloudTest/java/org/apache/polaris/service/it/{RestCatalogViewAzureIT.java => RestCatalogViewAdlsIT.java} (88%) rename runtime/service/src/cloudTest/java/org/apache/polaris/service/it/{RestCatalogViewGcpIT.java => RestCatalogViewGcsIT.java} (93%) rename runtime/service/src/cloudTest/java/org/apache/polaris/service/it/{RestCatalogViewAwsIT.java => RestCatalogViewS3IT.java} (93%) diff --git a/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogAzureIntegrationTestBase.java b/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogAdlsIntegrationTestBase.java similarity index 92% rename from integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogAzureIntegrationTestBase.java rename to integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogAdlsIntegrationTestBase.java index 923f3592b0..d033b5585f 100644 --- a/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogAzureIntegrationTestBase.java +++ b/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogAdlsIntegrationTestBase.java @@ -23,10 +23,10 @@ import org.apache.polaris.core.admin.model.StorageConfigInfo; /** Runs PolarisRestCatalogIntegrationBase test on Azure. */ -public abstract class PolarisRestCatalogAzureIntegrationTestBase +public abstract class PolarisRestCatalogAdlsIntegrationTestBase extends PolarisRestCatalogIntegrationBase { - public static final String TENANT_ID = System.getenv("INTEGRATION_TEST_AZURE_TENANT_ID"); - public static final String BASE_LOCATION = System.getenv("INTEGRATION_TEST_AZURE_PATH"); + public static final String TENANT_ID = System.getenv("INTEGRATION_TEST_ADLS_TENANT_ID"); + public static final String BASE_LOCATION = System.getenv("INTEGRATION_TEST_ADLS_PATH"); @Override protected StorageConfigInfo getStorageConfigInfo() { diff --git a/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogGcpIntegrationTestBase.java b/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogGcsIntegrationTestBase.java similarity index 96% rename from integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogGcpIntegrationTestBase.java rename to integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogGcsIntegrationTestBase.java index 381983933f..5990bc7c4e 100644 --- a/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogGcpIntegrationTestBase.java +++ b/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogGcsIntegrationTestBase.java @@ -23,7 +23,7 @@ import org.apache.polaris.core.admin.model.StorageConfigInfo; /** Runs PolarisRestCatalogIntegrationBase test on GCP. */ -public abstract class PolarisRestCatalogGcpIntegrationTestBase +public abstract class PolarisRestCatalogGcsIntegrationTestBase extends PolarisRestCatalogIntegrationBase { public static final String SERVICE_ACCOUNT = System.getenv("INTEGRATION_TEST_GCS_SERVICE_ACCOUNT"); diff --git a/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogAwsIntegrationTestBase.java b/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogS3IntegrationTestBase.java similarity index 96% rename from integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogAwsIntegrationTestBase.java rename to integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogS3IntegrationTestBase.java index 64bf0f221c..b3b34c6091 100644 --- a/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogAwsIntegrationTestBase.java +++ b/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogS3IntegrationTestBase.java @@ -24,7 +24,7 @@ import org.apache.polaris.core.admin.model.StorageConfigInfo; /** Runs PolarisRestCatalogIntegrationBase test on AWS. */ -public abstract class PolarisRestCatalogAwsIntegrationTestBase +public abstract class PolarisRestCatalogS3IntegrationTestBase extends PolarisRestCatalogIntegrationBase { public static final String ROLE_ARN = Optional.ofNullable(System.getenv("INTEGRATION_TEST_ROLE_ARN")) diff --git a/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewAzureIntegrationTestBase.java b/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewAdlsIntegrationTestBase.java similarity index 83% rename from integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewAzureIntegrationTestBase.java rename to integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewAdlsIntegrationTestBase.java index e4293d288a..adadb4f1cf 100644 --- a/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewAzureIntegrationTestBase.java +++ b/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewAdlsIntegrationTestBase.java @@ -23,19 +23,22 @@ import org.apache.hadoop.fs.Path; import org.apache.polaris.core.admin.model.AzureStorageConfigInfo; import org.apache.polaris.core.admin.model.StorageConfigInfo; +import org.apache.polaris.core.storage.StorageUtil; /** Runs PolarisRestCatalogViewIntegrationTest on Azure. */ -public abstract class PolarisRestCatalogViewAzureIntegrationTestBase +public abstract class PolarisRestCatalogViewAdlsIntegrationTestBase extends PolarisRestCatalogViewIntegrationBase { - public static final String TENANT_ID = System.getenv("INTEGRATION_TEST_AZURE_TENANT_ID"); - public static final String BASE_LOCATION = System.getenv("INTEGRATION_TEST_AZURE_PATH"); + public static final String TENANT_ID = System.getenv("INTEGRATION_TEST_ADLS_TENANT_ID"); + public static final String BASE_LOCATION = System.getenv("INTEGRATION_TEST_ADLS_PATH"); @Override protected StorageConfigInfo getStorageConfigInfo() { return AzureStorageConfigInfo.builder() .setTenantId(TENANT_ID) .setStorageType(StorageConfigInfo.StorageTypeEnum.AZURE) - .setAllowedLocations(List.of(new Path(BASE_LOCATION, POLARIS_IT_SUBDIR).toString())) + .setAllowedLocations( + List.of( + StorageUtil.concatFilePrefixes(BASE_LOCATION, POLARIS_IT_SUBDIR, Path.SEPARATOR))) .build(); } diff --git a/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewGcpIntegrationTestBase.java b/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewGcsIntegrationTestBase.java similarity index 86% rename from integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewGcpIntegrationTestBase.java rename to integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewGcsIntegrationTestBase.java index 970dd09785..b46f7f90c0 100644 --- a/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewGcpIntegrationTestBase.java +++ b/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewGcsIntegrationTestBase.java @@ -23,9 +23,10 @@ import org.apache.hadoop.fs.Path; import org.apache.polaris.core.admin.model.GcpStorageConfigInfo; import org.apache.polaris.core.admin.model.StorageConfigInfo; +import org.apache.polaris.core.storage.StorageUtil; /** Runs PolarisRestCatalogViewIntegrationTest on GCP. */ -public abstract class PolarisRestCatalogViewGcpIntegrationTestBase +public abstract class PolarisRestCatalogViewGcsIntegrationTestBase extends PolarisRestCatalogViewIntegrationBase { public static final String SERVICE_ACCOUNT = System.getenv("INTEGRATION_TEST_GCS_SERVICE_ACCOUNT"); @@ -36,7 +37,9 @@ protected StorageConfigInfo getStorageConfigInfo() { return GcpStorageConfigInfo.builder() .setGcsServiceAccount(SERVICE_ACCOUNT) .setStorageType(StorageConfigInfo.StorageTypeEnum.GCS) - .setAllowedLocations(List.of(new Path(BASE_LOCATION, POLARIS_IT_SUBDIR).toString())) + .setAllowedLocations( + List.of( + StorageUtil.concatFilePrefixes(BASE_LOCATION, POLARIS_IT_SUBDIR, Path.SEPARATOR))) .build(); } diff --git a/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewIntegrationBase.java b/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewIntegrationBase.java index b298a4c5e2..1c8ce717a4 100644 --- a/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewIntegrationBase.java +++ b/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewIntegrationBase.java @@ -22,8 +22,8 @@ import com.google.common.collect.ImmutableMap; import java.lang.reflect.Method; +import java.nio.file.Path; import java.util.Map; -import org.apache.hadoop.fs.Path; import org.apache.iceberg.catalog.TableIdentifier; import org.apache.iceberg.exceptions.ForbiddenException; import org.apache.iceberg.rest.RESTCatalog; @@ -46,7 +46,6 @@ import org.apache.polaris.service.it.env.PolarisClient; import org.apache.polaris.service.it.ext.PolarisIntegrationTestExtension; import org.assertj.core.api.AbstractBooleanAssert; -import org.assertj.core.api.AbstractStringAssert; import org.assertj.core.api.Assertions; import org.assertj.core.api.Assumptions; import org.assertj.core.configuration.PreferredAssumptionException; @@ -237,10 +236,15 @@ public void createViewWithCustomMetadataLocation() { .isTrue(); Assertions.assertThat(view.properties()) .containsEntry("write.metadata.path", baseCustomWriteMetadataLocation); - ((AbstractStringAssert) - Assertions.assertThat(((BaseView) view).operations().current().metadataFileLocation()) - .isNotNull()) - .startsWith(new Path(baseCustomWriteMetadataLocation).toString()); + + Assertions.assertThat(((BaseView) view).operations().current().metadataFileLocation()) + .isNotNull(); + // Normalize paths, remove schema before comparing + String metadataFileLocationPath = + Path.of(((BaseView) view).operations().current().metadataFileLocation()).toUri().getPath(); + String baseCustomWriteMetadataLocationPath = + Path.of(baseCustomWriteMetadataLocation).toUri().getPath(); + Assertions.assertThat(metadataFileLocationPath).startsWith(baseCustomWriteMetadataLocationPath); } @Test diff --git a/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewAwsIntegrationTestBase.java b/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewS3IntegrationTestBase.java similarity index 87% rename from integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewAwsIntegrationTestBase.java rename to integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewS3IntegrationTestBase.java index ee8cfa56d5..d77516d5c3 100644 --- a/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewAwsIntegrationTestBase.java +++ b/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewS3IntegrationTestBase.java @@ -24,9 +24,10 @@ import org.apache.hadoop.fs.Path; import org.apache.polaris.core.admin.model.AwsStorageConfigInfo; import org.apache.polaris.core.admin.model.StorageConfigInfo; +import org.apache.polaris.core.storage.StorageUtil; /** Runs PolarisRestCatalogViewIntegrationTest on AWS. */ -public abstract class PolarisRestCatalogViewAwsIntegrationTestBase +public abstract class PolarisRestCatalogViewS3IntegrationTestBase extends PolarisRestCatalogViewIntegrationBase { public static final String ROLE_ARN = Optional.ofNullable(System.getenv("INTEGRATION_TEST_ROLE_ARN")) // Backward compatibility @@ -38,7 +39,9 @@ protected StorageConfigInfo getStorageConfigInfo() { return AwsStorageConfigInfo.builder() .setRoleArn(ROLE_ARN) .setStorageType(StorageConfigInfo.StorageTypeEnum.S3) - .setAllowedLocations(List.of(new Path(BASE_LOCATION, POLARIS_IT_SUBDIR).toString())) + .setAllowedLocations( + List.of( + StorageUtil.concatFilePrefixes(BASE_LOCATION, POLARIS_IT_SUBDIR, Path.SEPARATOR))) .build(); } diff --git a/runtime/service/README.md b/runtime/service/README.md index 7d499b993f..52c37199cb 100644 --- a/runtime/service/README.md +++ b/runtime/service/README.md @@ -29,10 +29,10 @@ export INTEGRATION_TEST_S3_PATH="s3://bucket/subpath" export INTEGRATION_TEST_S3_ROLE_ARN="your-role-arn" ./gradlew :polaris-runtime-service:cloudTest ``` -For Azure: +For ADLS: ```shell -export INTEGRATION_TEST_AZURE_PATH="abfss://bucket/subpath" -export INTEGRATION_TEST_AZURE_TENANT_ID="your-tenant-id" +export INTEGRATION_TEST_ADLS_PATH="abfss://bucket/subpath" +export INTEGRATION_TEST_ADLS_TENANT_ID="your-tenant-id" ./gradlew :polaris-runtime-service:cloudTest ``` For GCS: diff --git a/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogAzureIT.java b/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogAdlsIT.java similarity index 79% rename from runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogAzureIT.java rename to runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogAdlsIT.java index d89bbf22d9..facc37c424 100644 --- a/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogAzureIT.java +++ b/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogAdlsIT.java @@ -19,9 +19,9 @@ package org.apache.polaris.service.it; import io.quarkus.test.junit.QuarkusIntegrationTest; -import org.apache.polaris.service.it.test.PolarisRestCatalogAzureIntegrationTestBase; +import org.apache.polaris.service.it.test.PolarisRestCatalogAdlsIntegrationTestBase; import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable; @QuarkusIntegrationTest -@EnabledIfEnvironmentVariable(named = "INTEGRATION_TEST_AZURE_PATH", matches = ".+") -public class RestCatalogAzureIT extends PolarisRestCatalogAzureIntegrationTestBase {} +@EnabledIfEnvironmentVariable(named = "INTEGRATION_TEST_ADLS_PATH", matches = ".+") +public class RestCatalogAdlsIT extends PolarisRestCatalogAdlsIntegrationTestBase {} diff --git a/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogGcpIT.java b/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogGcsIT.java similarity index 89% rename from runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogGcpIT.java rename to runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogGcsIT.java index 80448f0c2a..c098d0ba3b 100644 --- a/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogGcpIT.java +++ b/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogGcsIT.java @@ -19,9 +19,9 @@ package org.apache.polaris.service.it; import io.quarkus.test.junit.QuarkusIntegrationTest; -import org.apache.polaris.service.it.test.PolarisRestCatalogGcpIntegrationTestBase; +import org.apache.polaris.service.it.test.PolarisRestCatalogGcsIntegrationTestBase; import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable; @QuarkusIntegrationTest @EnabledIfEnvironmentVariable(named = "INTEGRATION_TEST_GCS_PATH", matches = ".+") -public class RestCatalogGcpIT extends PolarisRestCatalogGcpIntegrationTestBase {} +public class RestCatalogGcsIT extends PolarisRestCatalogGcsIntegrationTestBase {} diff --git a/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogAwsIT.java b/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogS3IT.java similarity index 86% rename from runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogAwsIT.java rename to runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogS3IT.java index a229c1c167..6e6f9d9669 100644 --- a/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogAwsIT.java +++ b/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogS3IT.java @@ -19,9 +19,9 @@ package org.apache.polaris.service.it; import io.quarkus.test.junit.QuarkusIntegrationTest; -import org.apache.polaris.service.it.test.PolarisRestCatalogAwsIntegrationTestBase; +import org.apache.polaris.service.it.test.PolarisRestCatalogS3IntegrationTestBase; import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable; @QuarkusIntegrationTest @EnabledIfEnvironmentVariable(named = "INTEGRATION_TEST_S3_PATH", matches = ".+") -public class RestCatalogAwsIT extends PolarisRestCatalogAwsIntegrationTestBase {} +public class RestCatalogS3IT extends PolarisRestCatalogS3IntegrationTestBase {} diff --git a/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogViewAzureIT.java b/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogViewAdlsIT.java similarity index 88% rename from runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogViewAzureIT.java rename to runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogViewAdlsIT.java index b73255d75c..46b8f09669 100644 --- a/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogViewAzureIT.java +++ b/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogViewAdlsIT.java @@ -22,14 +22,14 @@ import java.lang.reflect.Field; import java.nio.file.Path; import org.apache.iceberg.view.ViewCatalogTests; -import org.apache.polaris.service.it.test.PolarisRestCatalogViewAzureIntegrationTestBase; +import org.apache.polaris.service.it.test.PolarisRestCatalogViewAdlsIntegrationTestBase; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable; import org.junit.jupiter.api.io.TempDir; @QuarkusIntegrationTest -@EnabledIfEnvironmentVariable(named = "INTEGRATION_TEST_AZURE_PATH", matches = ".+") -public class RestCatalogViewAzureIT extends PolarisRestCatalogViewAzureIntegrationTestBase { +@EnabledIfEnvironmentVariable(named = "INTEGRATION_TEST_ADLS_PATH", matches = ".+") +public class RestCatalogViewAdlsIT extends PolarisRestCatalogViewAdlsIntegrationTestBase { @BeforeEach public void setUpTempDir(@TempDir Path tempDir) throws Exception { diff --git a/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogViewGcpIT.java b/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogViewGcsIT.java similarity index 93% rename from runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogViewGcpIT.java rename to runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogViewGcsIT.java index 751ceddfdc..36c48b0896 100644 --- a/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogViewGcpIT.java +++ b/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogViewGcsIT.java @@ -22,14 +22,14 @@ import java.lang.reflect.Field; import java.nio.file.Path; import org.apache.iceberg.view.ViewCatalogTests; -import org.apache.polaris.service.it.test.PolarisRestCatalogViewGcpIntegrationTestBase; +import org.apache.polaris.service.it.test.PolarisRestCatalogViewGcsIntegrationTestBase; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable; import org.junit.jupiter.api.io.TempDir; @QuarkusIntegrationTest @EnabledIfEnvironmentVariable(named = "INTEGRATION_TEST_GCS_PATH", matches = ".+") -public class RestCatalogViewGcpIT extends PolarisRestCatalogViewGcpIntegrationTestBase { +public class RestCatalogViewGcsIT extends PolarisRestCatalogViewGcsIntegrationTestBase { @BeforeEach public void setUpTempDir(@TempDir Path tempDir) throws Exception { diff --git a/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogViewAwsIT.java b/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogViewS3IT.java similarity index 93% rename from runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogViewAwsIT.java rename to runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogViewS3IT.java index cf58078154..65bc1e687a 100644 --- a/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogViewAwsIT.java +++ b/runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogViewS3IT.java @@ -22,14 +22,14 @@ import java.lang.reflect.Field; import java.nio.file.Path; import org.apache.iceberg.view.ViewCatalogTests; -import org.apache.polaris.service.it.test.PolarisRestCatalogViewAwsIntegrationTestBase; +import org.apache.polaris.service.it.test.PolarisRestCatalogViewS3IntegrationTestBase; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable; import org.junit.jupiter.api.io.TempDir; @QuarkusIntegrationTest @EnabledIfEnvironmentVariable(named = "INTEGRATION_TEST_S3_PATH", matches = ".+") -public class RestCatalogViewAwsIT extends PolarisRestCatalogViewAwsIntegrationTestBase { +public class RestCatalogViewS3IT extends PolarisRestCatalogViewS3IntegrationTestBase { @BeforeEach public void setUpTempDir(@TempDir Path tempDir) throws Exception { From c34120f78be1327f769938cf6d0cbbb0fac276a7 Mon Sep 17 00:00:00 2001 From: Tamas Mate Date: Sun, 24 Aug 2025 20:27:58 +0200 Subject: [PATCH 3/3] Self-review --- .../PolarisRestCatalogViewAdlsIntegrationTestBase.java | 7 +++---- .../test/PolarisRestCatalogViewGcsIntegrationTestBase.java | 7 +++---- .../test/PolarisRestCatalogViewS3IntegrationTestBase.java | 7 +++---- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewAdlsIntegrationTestBase.java b/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewAdlsIntegrationTestBase.java index adadb4f1cf..a2f73d76d7 100644 --- a/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewAdlsIntegrationTestBase.java +++ b/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewAdlsIntegrationTestBase.java @@ -18,9 +18,8 @@ */ package org.apache.polaris.service.it.test; -import com.google.common.base.Strings; +import java.io.File; import java.util.List; -import org.apache.hadoop.fs.Path; import org.apache.polaris.core.admin.model.AzureStorageConfigInfo; import org.apache.polaris.core.admin.model.StorageConfigInfo; import org.apache.polaris.core.storage.StorageUtil; @@ -38,12 +37,12 @@ protected StorageConfigInfo getStorageConfigInfo() { .setStorageType(StorageConfigInfo.StorageTypeEnum.AZURE) .setAllowedLocations( List.of( - StorageUtil.concatFilePrefixes(BASE_LOCATION, POLARIS_IT_SUBDIR, Path.SEPARATOR))) + StorageUtil.concatFilePrefixes(BASE_LOCATION, POLARIS_IT_SUBDIR, File.separator))) .build(); } @Override protected String getCustomMetadataLocationDir() { - return new Path(BASE_LOCATION, POLARIS_IT_CUSTOM_SUBDIR).toString(); + return StorageUtil.concatFilePrefixes(BASE_LOCATION, POLARIS_IT_SUBDIR, File.separator); } } diff --git a/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewGcsIntegrationTestBase.java b/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewGcsIntegrationTestBase.java index b46f7f90c0..f7e0468571 100644 --- a/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewGcsIntegrationTestBase.java +++ b/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewGcsIntegrationTestBase.java @@ -18,9 +18,8 @@ */ package org.apache.polaris.service.it.test; -import com.google.common.base.Strings; +import java.io.File; import java.util.List; -import org.apache.hadoop.fs.Path; import org.apache.polaris.core.admin.model.GcpStorageConfigInfo; import org.apache.polaris.core.admin.model.StorageConfigInfo; import org.apache.polaris.core.storage.StorageUtil; @@ -39,12 +38,12 @@ protected StorageConfigInfo getStorageConfigInfo() { .setStorageType(StorageConfigInfo.StorageTypeEnum.GCS) .setAllowedLocations( List.of( - StorageUtil.concatFilePrefixes(BASE_LOCATION, POLARIS_IT_SUBDIR, Path.SEPARATOR))) + StorageUtil.concatFilePrefixes(BASE_LOCATION, POLARIS_IT_SUBDIR, File.separator))) .build(); } @Override protected String getCustomMetadataLocationDir() { - return new Path(BASE_LOCATION, POLARIS_IT_CUSTOM_SUBDIR).toString(); + return StorageUtil.concatFilePrefixes(BASE_LOCATION, POLARIS_IT_SUBDIR, File.separator); } } diff --git a/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewS3IntegrationTestBase.java b/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewS3IntegrationTestBase.java index d77516d5c3..56c01b5402 100644 --- a/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewS3IntegrationTestBase.java +++ b/integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewS3IntegrationTestBase.java @@ -18,10 +18,9 @@ */ package org.apache.polaris.service.it.test; -import com.google.common.base.Strings; +import java.io.File; import java.util.List; import java.util.Optional; -import org.apache.hadoop.fs.Path; import org.apache.polaris.core.admin.model.AwsStorageConfigInfo; import org.apache.polaris.core.admin.model.StorageConfigInfo; import org.apache.polaris.core.storage.StorageUtil; @@ -41,12 +40,12 @@ protected StorageConfigInfo getStorageConfigInfo() { .setStorageType(StorageConfigInfo.StorageTypeEnum.S3) .setAllowedLocations( List.of( - StorageUtil.concatFilePrefixes(BASE_LOCATION, POLARIS_IT_SUBDIR, Path.SEPARATOR))) + StorageUtil.concatFilePrefixes(BASE_LOCATION, POLARIS_IT_SUBDIR, File.separator))) .build(); } @Override protected String getCustomMetadataLocationDir() { - return new Path(BASE_LOCATION, POLARIS_IT_CUSTOM_SUBDIR).toString(); + return StorageUtil.concatFilePrefixes(BASE_LOCATION, POLARIS_IT_SUBDIR, File.separator); } }