|
22 | 22 |
|
23 | 23 | import com.google.common.collect.ImmutableMap;
|
24 | 24 | import java.lang.reflect.Method;
|
| 25 | +import java.nio.file.Path; |
25 | 26 | import java.util.Map;
|
26 |
| -import org.apache.hadoop.fs.Path; |
27 | 27 | import org.apache.iceberg.catalog.TableIdentifier;
|
28 | 28 | import org.apache.iceberg.exceptions.ForbiddenException;
|
29 | 29 | import org.apache.iceberg.rest.RESTCatalog;
|
|
46 | 46 | import org.apache.polaris.service.it.env.PolarisClient;
|
47 | 47 | import org.apache.polaris.service.it.ext.PolarisIntegrationTestExtension;
|
48 | 48 | import org.assertj.core.api.AbstractBooleanAssert;
|
49 |
| -import org.assertj.core.api.AbstractStringAssert; |
50 | 49 | import org.assertj.core.api.Assertions;
|
51 | 50 | import org.assertj.core.api.Assumptions;
|
52 | 51 | import org.assertj.core.configuration.PreferredAssumptionException;
|
@@ -237,10 +236,15 @@ public void createViewWithCustomMetadataLocation() {
|
237 | 236 | .isTrue();
|
238 | 237 | Assertions.assertThat(view.properties())
|
239 | 238 | .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); |
244 | 248 | }
|
245 | 249 |
|
246 | 250 | @Test
|
|
0 commit comments