rdblue commented on code in PR #18304:
URL: https://github.com/apache/iceberg/pull/18304#discussion_r4223243307
##########
core/src/test/java/org/apache/iceberg/TestLocationProvider.java:
##########
@@ -263,6 +263,26 @@ public void testObjectStorageWithinTableLocation() {
assertThat(parts).element(6).asString().isEqualTo("test.parquet");
}
+ @TestTemplate
+ public void testObjectStoragePathContext() {
+ assertPathContext("s3://bucket/db/table", "db/table");
+ assertPathContext("s3://bucket/db/table/", "db/table");
+ assertPathContext("s3://bucket/ns/db/table", "db/table");
+ assertPathContext("s3://bucket/table", "/table");
+ assertPathContext("s3://bucket", "");
+ }
+
+ private static void assertPathContext(String tableLocation, String
expectedContext) {
+ LocationProvider provider =
+ new LocationProviders.ObjectStoreLocationProvider(
+ tableLocation, Map.of(TableProperties.WRITE_DATA_LOCATION,
"s3://other/data"));
Review Comment:
I don't think that this helper method is useful. It is only called from one
test case so this provider can be embedded there. That would be more readable.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]