Skip to content

Commit 5a637e7

Browse files
committed
Addressing review comments, rebase
1 parent 8c1b600 commit 5a637e7

14 files changed

+49
-36
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@
2323
import org.apache.polaris.core.admin.model.StorageConfigInfo;
2424

2525
/** Runs PolarisRestCatalogIntegrationBase test on Azure. */
26-
public abstract class PolarisRestCatalogAzureIntegrationTestBase
26+
public abstract class PolarisRestCatalogAdlsIntegrationTestBase
2727
extends PolarisRestCatalogIntegrationBase {
28-
public static final String TENANT_ID = System.getenv("INTEGRATION_TEST_AZURE_TENANT_ID");
29-
public static final String BASE_LOCATION = System.getenv("INTEGRATION_TEST_AZURE_PATH");
28+
public static final String TENANT_ID = System.getenv("INTEGRATION_TEST_ADLS_TENANT_ID");
29+
public static final String BASE_LOCATION = System.getenv("INTEGRATION_TEST_ADLS_PATH");
3030

3131
@Override
3232
protected StorageConfigInfo getStorageConfigInfo() {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import org.apache.polaris.core.admin.model.StorageConfigInfo;
2424

2525
/** Runs PolarisRestCatalogIntegrationBase test on GCP. */
26-
public abstract class PolarisRestCatalogGcpIntegrationTestBase
26+
public abstract class PolarisRestCatalogGcsIntegrationTestBase
2727
extends PolarisRestCatalogIntegrationBase {
2828
public static final String SERVICE_ACCOUNT =
2929
System.getenv("INTEGRATION_TEST_GCS_SERVICE_ACCOUNT");
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import org.apache.polaris.core.admin.model.StorageConfigInfo;
2525

2626
/** Runs PolarisRestCatalogIntegrationBase test on AWS. */
27-
public abstract class PolarisRestCatalogAwsIntegrationTestBase
27+
public abstract class PolarisRestCatalogS3IntegrationTestBase
2828
extends PolarisRestCatalogIntegrationBase {
2929
public static final String ROLE_ARN =
3030
Optional.ofNullable(System.getenv("INTEGRATION_TEST_ROLE_ARN"))
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,22 @@
2222
import org.apache.hadoop.fs.Path;
2323
import org.apache.polaris.core.admin.model.AzureStorageConfigInfo;
2424
import org.apache.polaris.core.admin.model.StorageConfigInfo;
25+
import org.apache.polaris.core.storage.StorageUtil;
2526

2627
/** Runs PolarisRestCatalogViewIntegrationTest on Azure. */
27-
public abstract class PolarisRestCatalogViewAzureIntegrationTestBase
28+
public abstract class PolarisRestCatalogViewAdlsIntegrationTestBase
2829
extends PolarisRestCatalogViewIntegrationBase {
29-
public static final String TENANT_ID = System.getenv("INTEGRATION_TEST_AZURE_TENANT_ID");
30-
public static final String BASE_LOCATION = System.getenv("INTEGRATION_TEST_AZURE_PATH");
30+
public static final String TENANT_ID = System.getenv("INTEGRATION_TEST_ADLS_TENANT_ID");
31+
public static final String BASE_LOCATION = System.getenv("INTEGRATION_TEST_ADLS_PATH");
3132

3233
@Override
3334
protected StorageConfigInfo getStorageConfigInfo() {
3435
return AzureStorageConfigInfo.builder()
3536
.setTenantId(TENANT_ID)
3637
.setStorageType(StorageConfigInfo.StorageTypeEnum.AZURE)
37-
.setAllowedLocations(List.of(new Path(BASE_LOCATION, POLARIS_IT_SUBDIR).toString()))
38+
.setAllowedLocations(
39+
List.of(
40+
StorageUtil.concatFilePrefixes(BASE_LOCATION, POLARIS_IT_SUBDIR, Path.SEPARATOR)))
3841
.build();
3942
}
4043

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@
2222
import org.apache.hadoop.fs.Path;
2323
import org.apache.polaris.core.admin.model.GcpStorageConfigInfo;
2424
import org.apache.polaris.core.admin.model.StorageConfigInfo;
25+
import org.apache.polaris.core.storage.StorageUtil;
2526

2627
/** Runs PolarisRestCatalogViewIntegrationTest on GCP. */
27-
public abstract class PolarisRestCatalogViewGcpIntegrationTestBase
28+
public abstract class PolarisRestCatalogViewGcsIntegrationTestBase
2829
extends PolarisRestCatalogViewIntegrationBase {
2930
public static final String SERVICE_ACCOUNT =
3031
System.getenv("INTEGRATION_TEST_GCS_SERVICE_ACCOUNT");
@@ -35,7 +36,9 @@ protected StorageConfigInfo getStorageConfigInfo() {
3536
return GcpStorageConfigInfo.builder()
3637
.setGcsServiceAccount(SERVICE_ACCOUNT)
3738
.setStorageType(StorageConfigInfo.StorageTypeEnum.GCS)
38-
.setAllowedLocations(List.of(new Path(BASE_LOCATION, POLARIS_IT_SUBDIR).toString()))
39+
.setAllowedLocations(
40+
List.of(
41+
StorageUtil.concatFilePrefixes(BASE_LOCATION, POLARIS_IT_SUBDIR, Path.SEPARATOR)))
3942
.build();
4043
}
4144

integration-tests/src/main/java/org/apache/polaris/service/it/test/PolarisRestCatalogViewIntegrationBase.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222

2323
import com.google.common.collect.ImmutableMap;
2424
import java.lang.reflect.Method;
25+
import java.nio.file.Path;
2526
import java.util.Map;
26-
import org.apache.hadoop.fs.Path;
2727
import org.apache.iceberg.catalog.TableIdentifier;
2828
import org.apache.iceberg.exceptions.ForbiddenException;
2929
import org.apache.iceberg.rest.RESTCatalog;
@@ -46,7 +46,6 @@
4646
import org.apache.polaris.service.it.env.PolarisClient;
4747
import org.apache.polaris.service.it.ext.PolarisIntegrationTestExtension;
4848
import org.assertj.core.api.AbstractBooleanAssert;
49-
import org.assertj.core.api.AbstractStringAssert;
5049
import org.assertj.core.api.Assertions;
5150
import org.assertj.core.api.Assumptions;
5251
import org.assertj.core.configuration.PreferredAssumptionException;
@@ -237,10 +236,15 @@ public void createViewWithCustomMetadataLocation() {
237236
.isTrue();
238237
Assertions.assertThat(view.properties())
239238
.containsEntry("write.metadata.path", baseCustomWriteMetadataLocation);
240-
((AbstractStringAssert)
241-
Assertions.assertThat(((BaseView) view).operations().current().metadataFileLocation())
242-
.isNotNull())
243-
.startsWith(new Path(baseCustomWriteMetadataLocation).toString());
239+
240+
Assertions.assertThat(((BaseView) view).operations().current().metadataFileLocation())
241+
.isNotNull();
242+
// Normalize paths, remove schema before comparing
243+
String metadataFileLocationPath =
244+
Path.of(((BaseView) view).operations().current().metadataFileLocation()).toUri().getPath();
245+
String baseCustomWriteMetadataLocationPath =
246+
Path.of(baseCustomWriteMetadataLocation).toUri().getPath();
247+
Assertions.assertThat(metadataFileLocationPath).startsWith(baseCustomWriteMetadataLocationPath);
244248
}
245249

246250
@Test
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@
2323
import org.apache.hadoop.fs.Path;
2424
import org.apache.polaris.core.admin.model.AwsStorageConfigInfo;
2525
import org.apache.polaris.core.admin.model.StorageConfigInfo;
26+
import org.apache.polaris.core.storage.StorageUtil;
2627

2728
/** Runs PolarisRestCatalogViewIntegrationTest on AWS. */
28-
public abstract class PolarisRestCatalogViewAwsIntegrationTestBase
29+
public abstract class PolarisRestCatalogViewS3IntegrationTestBase
2930
extends PolarisRestCatalogViewIntegrationBase {
3031
public static final String ROLE_ARN =
3132
Optional.ofNullable(System.getenv("INTEGRATION_TEST_ROLE_ARN")) // Backward compatibility
@@ -37,7 +38,9 @@ protected StorageConfigInfo getStorageConfigInfo() {
3738
return AwsStorageConfigInfo.builder()
3839
.setRoleArn(ROLE_ARN)
3940
.setStorageType(StorageConfigInfo.StorageTypeEnum.S3)
40-
.setAllowedLocations(List.of(new Path(BASE_LOCATION, POLARIS_IT_SUBDIR).toString()))
41+
.setAllowedLocations(
42+
List.of(
43+
StorageUtil.concatFilePrefixes(BASE_LOCATION, POLARIS_IT_SUBDIR, Path.SEPARATOR)))
4144
.build();
4245
}
4346

runtime/service/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ export INTEGRATION_TEST_S3_PATH="s3://bucket/subpath"
2929
export INTEGRATION_TEST_S3_ROLE_ARN="your-role-arn"
3030
./gradlew :polaris-runtime-service:cloudTest
3131
```
32-
For Azure:
32+
For ADLS:
3333
```shell
34-
export INTEGRATION_TEST_AZURE_PATH="abfss://bucket/subpath"
35-
export INTEGRATION_TEST_AZURE_TENANT_ID="your-tenant-id"
34+
export INTEGRATION_TEST_ADLS_PATH="abfss://bucket/subpath"
35+
export INTEGRATION_TEST_ADLS_TENANT_ID="your-tenant-id"
3636
./gradlew :polaris-runtime-service:cloudTest
3737
```
3838
For GCS:
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
package org.apache.polaris.service.it;
2020

2121
import io.quarkus.test.junit.QuarkusIntegrationTest;
22-
import org.apache.polaris.service.it.test.PolarisRestCatalogAzureIntegrationTestBase;
22+
import org.apache.polaris.service.it.test.PolarisRestCatalogAdlsIntegrationTestBase;
2323
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
2424

2525
@QuarkusIntegrationTest
26-
@EnabledIfEnvironmentVariable(named = "INTEGRATION_TEST_AZURE_PATH", matches = ".+")
27-
public class RestCatalogAzureIT extends PolarisRestCatalogAzureIntegrationTestBase {}
26+
@EnabledIfEnvironmentVariable(named = "INTEGRATION_TEST_ADLS_PATH", matches = ".+")
27+
public class RestCatalogAdlsIT extends PolarisRestCatalogAdlsIntegrationTestBase {}

runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogGcpIT.java renamed to runtime/service/src/cloudTest/java/org/apache/polaris/service/it/RestCatalogGcsIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
package org.apache.polaris.service.it;
2020

2121
import io.quarkus.test.junit.QuarkusIntegrationTest;
22-
import org.apache.polaris.service.it.test.PolarisRestCatalogGcpIntegrationTestBase;
22+
import org.apache.polaris.service.it.test.PolarisRestCatalogGcsIntegrationTestBase;
2323
import org.junit.jupiter.api.condition.EnabledIfEnvironmentVariable;
2424

2525
@QuarkusIntegrationTest
2626
@EnabledIfEnvironmentVariable(named = "INTEGRATION_TEST_GCS_PATH", matches = ".+")
27-
public class RestCatalogGcpIT extends PolarisRestCatalogGcpIntegrationTestBase {}
27+
public class RestCatalogGcsIT extends PolarisRestCatalogGcsIntegrationTestBase {}

0 commit comments

Comments
 (0)