Github user pwendell commented on a diff in the pull request:
https://github.com/apache/spark/pull/853#discussion_r12987849
--- Diff: core/src/main/scala/org/apache/spark/util/Utils.scala ---
@@ -1166,4 +1166,35 @@ private[spark] object Utils extends Logging {
true
}
}
+
+ /** Return the URI of the input path. If a relative path is given,
assume it is local. */
+ def resolveURI(path: String, testWindows: Boolean = false): URI = {
+
+ // On Windows, file names cannot contain backslashes and colons,
+ // and each drive contains only a single alphabet character
+ val windows = isWindows || testWindows
+ val sanitizedPath = if (windows) path.replace("\\", "/") else path
--- End diff --
Might be good to document this and just say `// Convert from Windows path
syntax to URI syntax` or something:. In my mind "sanitized" would convey that
you are e.g. encoding special characters. But really this is just converting
from one format to another.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---