You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "abmo-x (via GitHub)" <gi...@apache.org> on 2024/02/02 01:31:39 UTC

[PR] only trim slash when warehouse location is not root path [iceberg]

abmo-x opened a new pull request, #9619:
URL: https://github.com/apache/iceberg/pull/9619

   currently root paths like 'scheme://' get trimmed to 'scheme:' making them unusable.


-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Core: only trim slash when warehouse location is not root path [iceberg]

Posted by "nastra (via GitHub)" <gi...@apache.org>.
nastra commented on PR #9619:
URL: https://github.com/apache/iceberg/pull/9619#issuecomment-1929423667

   @amogh-jahagirdar could you also take a look please?


-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Core: only trim slash when warehouse location is not root path [iceberg]

Posted by "amogh-jahagirdar (via GitHub)" <gi...@apache.org>.
amogh-jahagirdar merged PR #9619:
URL: https://github.com/apache/iceberg/pull/9619


-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Core: only trim slash when warehouse location is not root path [iceberg]

Posted by "amogh-jahagirdar (via GitHub)" <gi...@apache.org>.
amogh-jahagirdar commented on PR #9619:
URL: https://github.com/apache/iceberg/pull/9619#issuecomment-1930907632

   I'll go ahead and merge, thanks @nastra for the review


-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Core: only trim slash when warehouse location is not root path [iceberg]

Posted by "nastra (via GitHub)" <gi...@apache.org>.
nastra commented on code in PR #9619:
URL: https://github.com/apache/iceberg/pull/9619#discussion_r1479331574


##########
core/src/test/java/org/apache/iceberg/util/TestLocationUtil.java:
##########
@@ -58,4 +58,30 @@ public void testStripTrailingSlashWithInvalidPath() {
           .hasMessage("path must not be null or empty");
     }
   }
+
+  @Test
+  void testStripTrailingSlashForRootPath() {

Review Comment:
   ```suggestion
     void testDoNotStripTrailingSlashForRootPath() {
   ```
   
   this is because it shouldn't strip the trailing slash in this case



-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] only trim slash when warehouse location is not root path [iceberg]

Posted by "abmo-x (via GitHub)" <gi...@apache.org>.
abmo-x commented on code in PR #9619:
URL: https://github.com/apache/iceberg/pull/9619#discussion_r1476934235


##########
core/src/main/java/org/apache/iceberg/hadoop/HadoopCatalog.java:
##########
@@ -108,7 +108,10 @@ public void initialize(String name, Map<String, String> properties) {
         "Cannot initialize HadoopCatalog because warehousePath must not be null or empty");
 
     this.catalogName = name;
-    this.warehouseLocation = LocationUtil.stripTrailingSlash(inputWarehouseLocation);
+    this.warehouseLocation = inputWarehouseLocation;
+    if (!warehouseLocation.endsWith("://")) {

Review Comment:
   Makes sense, as the util was also used for file paths I didn't put it in there. 
   moved it into LocationUtil and added tests



-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Core: only trim slash when warehouse location is not root path [iceberg]

Posted by "nastra (via GitHub)" <gi...@apache.org>.
nastra commented on code in PR #9619:
URL: https://github.com/apache/iceberg/pull/9619#discussion_r1477771865


##########
core/src/test/java/org/apache/iceberg/util/TestLocationUtil.java:
##########
@@ -46,6 +46,21 @@ public void testStripTrailingSlash() {
     assertThat(LocationUtil.stripTrailingSlash(pathWithOnlySlash))
         .as("Should have no trailing slashes")
         .isEmpty();
+
+    String rootPath = "blobstore://";

Review Comment:
   can you please separate these all into their own separate test methods? That was we test only a single thing per test method



-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] only trim slash when warehouse location is not root path [iceberg]

Posted by "nastra (via GitHub)" <gi...@apache.org>.
nastra commented on code in PR #9619:
URL: https://github.com/apache/iceberg/pull/9619#discussion_r1475739131


##########
core/src/main/java/org/apache/iceberg/hadoop/HadoopCatalog.java:
##########
@@ -108,7 +108,10 @@ public void initialize(String name, Map<String, String> properties) {
         "Cannot initialize HadoopCatalog because warehousePath must not be null or empty");
 
     this.catalogName = name;
-    this.warehouseLocation = LocationUtil.stripTrailingSlash(inputWarehouseLocation);
+    this.warehouseLocation = inputWarehouseLocation;
+    if (!warehouseLocation.endsWith("://")) {

Review Comment:
   I think this should be rather fixed directly in `LocationUtil.stripTrailingSlash()` and we also need tests in `TestLocationUtil`



-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Core: only trim slash when warehouse location is not root path [iceberg]

Posted by "nastra (via GitHub)" <gi...@apache.org>.
nastra commented on code in PR #9619:
URL: https://github.com/apache/iceberg/pull/9619#discussion_r1477771865


##########
core/src/test/java/org/apache/iceberg/util/TestLocationUtil.java:
##########
@@ -46,6 +46,21 @@ public void testStripTrailingSlash() {
     assertThat(LocationUtil.stripTrailingSlash(pathWithOnlySlash))
         .as("Should have no trailing slashes")
         .isEmpty();
+
+    String rootPath = "blobstore://";

Review Comment:
   can you please separate these all into their own separate test methods? That was we test only a single thing per test method (this should have been done for the existing test code already)



-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] Core: only trim slash when warehouse location is not root path [iceberg]

Posted by "abmo-x (via GitHub)" <gi...@apache.org>.
abmo-x commented on code in PR #9619:
URL: https://github.com/apache/iceberg/pull/9619#discussion_r1478622304


##########
core/src/test/java/org/apache/iceberg/util/TestLocationUtil.java:
##########
@@ -46,6 +46,21 @@ public void testStripTrailingSlash() {
     assertThat(LocationUtil.stripTrailingSlash(pathWithOnlySlash))
         .as("Should have no trailing slashes")
         .isEmpty();
+
+    String rootPath = "blobstore://";

Review Comment:
   Done



-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org