-
Notifications
You must be signed in to change notification settings - Fork 165
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
Encode special characters in ADLS Gen2 URI #3937
Conversation
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.
Thanks Rui! It's a deep hidden bug.
@@ -298,10 +297,10 @@ open class SparkSubmissionContentPanel(private val myProject: Project, val type: | |||
} | |||
|
|||
private val refJarsPrompt: JLabel = JLabel("Referenced Jars(spark.jars)").apply { | |||
toolTipText = "Files to be placed on the java classpath; The path needs to be an Azure Blob Storage Path (path started with wasb://); Multiple paths should be split by semicolon (;)" | |||
toolTipText = "Files to be placed on the java classpath. Multiple paths should be split by space." |
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.
Looks like we also need to update documents.
} | ||
|
||
@Override | ||
AzureStorageUri normalizeWithSlashEnding() { | ||
return AbfsUri.parse(UriUtil.normalizeWithSlashEnding(getUri()).toString()); | ||
AzureStorageUri parseUri(String encodedUri) { |
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.
The type might have to be aligned with name.
AzureStorageUri parseUri(String encodedUri) { | |
AzureStorageUri parseUri(URI encodedUri) { | |
``` #Resolved |
@@ -47,7 +49,7 @@ public URI getRawUri() { | |||
} | |||
|
|||
/** | |||
* Get URI with specified scheme, not limited to HTTP or HTTPS | |||
* Get URI with specified scheme except HTTP and HTTPS |
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.
Thanks! This is just the right expression. #Resolved
public static final Pattern ABFS_URI_PATTERN = Pattern.compile(AdlsGen2PathPattern, Pattern.CASE_INSENSITIVE); | ||
public static final Pattern HTTP_URI_PATTERN = Pattern.compile(AdlsGen2RestfulPathPattern, Pattern.CASE_INSENSITIVE); | ||
|
||
private final LaterInit<String> fileSystem = new LaterInit<>(); | ||
private final LaterInit<String> accountName = new LaterInit<>(); | ||
private final LaterInit<String> relativePath = new LaterInit<>(); | ||
private final LaterInit<String> path = new LaterInit<>(); |
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.
Looks like path
can be a member of base class. #Resolved
@@ -57,42 +57,43 @@ public String getAccountName() { | |||
|
|||
@Override | |||
public String getPath() { | |||
return relativePath.get(); | |||
return URI.create(path.get()).getPath(); |
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 store the path as URI
? #Resolved
* @param rawPath un-encoded raw path in the Azure Storage URI | ||
* @return encoded path in the Azure Storage URI | ||
*/ | ||
public static String encodePath(String rawPath) { |
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 suppose we don't need this method any more. Refer to the code .resolve("./" + target)
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.
Let's try this:
public static String encodeWithNormalizePath(String rawPath) {
String encodedPath = URI.create("/").relativize(new URIBuilder().setPath("/" + rawPath).build());
return rawPath.startsWith("/") ? "/" + encodedPath : encodedPath;
}
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! Shipit!
…next Encode special characters in ADLS Gen2 URI (microsoft#3937)
* Encode special characters in ADLS Gen2 URI
…next Encode special characters in ADLS Gen2 URI (microsoft#3937)
Changed
Fixed
Feature Request