-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Support WASB scheme in ADLSFileIO #11504
Merged
bryanck
merged 3 commits into
apache:main
from
mrcnc:support-wasb-scheme-for-adlsfileio
Nov 14, 2024
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,7 +33,18 @@ public void testLocationParsing(String scheme) { | |
String p1 = scheme + "://[email protected]/path/to/file"; | ||
ADLSLocation location = new ADLSLocation(p1); | ||
|
||
assertThat(location.storageAccount()).isEqualTo("account.dfs.core.windows.net"); | ||
assertThat(location.storageAccount()).isEqualTo("account"); | ||
assertThat(location.container().get()).isEqualTo("container"); | ||
assertThat(location.path()).isEqualTo("path/to/file"); | ||
} | ||
|
||
@ParameterizedTest | ||
@ValueSource(strings = {"wasb", "wasbs"}) | ||
public void testWasbLocatonParsing(String scheme) { | ||
String p1 = scheme + "://[email protected]/path/to/file"; | ||
ADLSLocation location = new ADLSLocation(p1); | ||
|
||
assertThat(location.storageAccount()).isEqualTo("account"); | ||
assertThat(location.container().get()).isEqualTo("container"); | ||
assertThat(location.path()).isEqualTo("path/to/file"); | ||
} | ||
|
@@ -43,7 +54,7 @@ public void testEncodedString() { | |
String p1 = "abfs://[email protected]/path%20to%20file"; | ||
ADLSLocation location = new ADLSLocation(p1); | ||
|
||
assertThat(location.storageAccount()).isEqualTo("account.dfs.core.windows.net"); | ||
assertThat(location.storageAccount()).isEqualTo("account"); | ||
assertThat(location.container().get()).isEqualTo("container"); | ||
assertThat(location.path()).isEqualTo("path%20to%20file"); | ||
} | ||
|
@@ -67,7 +78,7 @@ public void testNoContainer() { | |
String p1 = "abfs://account.dfs.core.windows.net/path/to/file"; | ||
ADLSLocation location = new ADLSLocation(p1); | ||
|
||
assertThat(location.storageAccount()).isEqualTo("account.dfs.core.windows.net"); | ||
assertThat(location.storageAccount()).isEqualTo("account"); | ||
assertThat(location.container().isPresent()).isFalse(); | ||
assertThat(location.path()).isEqualTo("path/to/file"); | ||
} | ||
|
@@ -77,7 +88,7 @@ public void testNoPath() { | |
String p1 = "abfs://[email protected]"; | ||
ADLSLocation location = new ADLSLocation(p1); | ||
|
||
assertThat(location.storageAccount()).isEqualTo("account.dfs.core.windows.net"); | ||
assertThat(location.storageAccount()).isEqualTo("account"); | ||
assertThat(location.container().get()).isEqualTo("container"); | ||
assertThat(location.path()).isEqualTo(""); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Should we really change add
.def.core.windows.net
by default ?I mean that use currently include the suffix in
account
so it should be clearly state that we append the suffix by default now.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.
I believe the
storageAccount
ofADLSLocation
should be used for storing the storage account name only. And since the ADLS APIs are accessed viadfs.core.windows.net
by default, I think it's appropriate to append it to the storage account name here as the default. If users want to specify a different hostname, they can use theadls.connection-string
property.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.
I think this is the right thing to do, I would just throw a javadoc on this method though
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 deviates from the
abfs[s]
scheme defined by Hadoop, where the domain is specified in the URI (docs). I feel we should check if the account already ends with the domain and only append then to support that.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.
I see, you are stripping off the domain below, so this isn't an issue. You can ignore the above.