Skip to content
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

Merged
merged 1 commit into from Jan 5, 2024

Conversation

ajantha-bhat
Copy link
Member

Other catalogs does the same and for some file system double slash in a path creates the problem.

@github-actions github-actions bot added the NESSIE label Jan 5, 2024
@@ -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);
Copy link
Member Author

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

@ajantha-bhat
Copy link
Member Author

cc: @snazy, @dimas-b , @adutra

@ajantha-bhat ajantha-bhat added this to the Iceberg 1.5.0 milestone Jan 5, 2024
public void testWarehouseLocationWithTrailingSlash() {
Assertions.assertThat(catalog.defaultWarehouseLocation(TABLE))
.startsWith(
LocationUtil.stripTrailingSlash(temp.toUri().toString())
Copy link
Member Author

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.

Copy link
Contributor

@Fokko Fokko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nastra nastra merged commit c416c29 into apache:main Jan 5, 2024
41 checks passed
geruh pushed a commit to geruh/iceberg that referenced this pull request Jan 26, 2024
adnanhemani pushed a commit to adnanhemani/iceberg that referenced this pull request Jan 30, 2024
devangjhabakh pushed a commit to cdouglas/iceberg that referenced this pull request Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants