-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nessie: Strip trailing slash for warehouse location #9415
Conversation
@@ -183,7 +184,8 @@ private String validateWarehouseLocation(String name, Map<String, String> catalo | |||
catalogOptions); | |||
throw new IllegalStateException("Parameter 'warehouse' not set, Nessie can't store data."); | |||
} | |||
return warehouseLocation; | |||
|
|||
return LocationUtil.stripTrailingSlash(warehouseLocation); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just making this inline with other catalogs.
We can lookup the callers of LocationUtil.stripTrailingSlash
public void testWarehouseLocationWithTrailingSlash() { | ||
Assertions.assertThat(catalog.defaultWarehouseLocation(TABLE)) | ||
.startsWith( | ||
LocationUtil.stripTrailingSlash(temp.toUri().toString()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This testcase was failing without the fix as temp.toUri()
was having trailing slash which was leading to double slash in the path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Other catalogs does the same and for some file system double slash in a path creates the problem.