Github user shivaram commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14960#discussion_r77573002
  
    --- Diff: core/src/main/scala/org/apache/spark/util/Utils.scala ---
    @@ -1900,7 +1900,20 @@ private[spark] object Utils extends Logging {
        */
       def resolveURI(path: String): URI = {
         try {
    -      val uri = new URI(path)
    +      val osSafePath = if (Path.isWindowsAbsolutePath(path, false)) {
    +        // Make sure C:/ part becomes /C/.
    +        val windowsUri = new URI(path)
    +        val driveLetter = windowsUri.getScheme
    +        s"/$driveLetter/${windowsUri.getSchemeSpecificPart()}"
    +      } else if (Path.isWindowsAbsolutePath(path, true)) {
    +        // Make sure /C:/ part becomes /C/.
    +        val windowsUri = new URI(path.substring(1))
    +        val driveLetter = windowsUri.getScheme
    +        s"/$driveLetter/${windowsUri.getSchemeSpecificPart()}"
    --- End diff --
    
    The other option is to of course just use the Hadoop `Path` class and do 
something like `new Path(path).toURI` -- I think they handle `C:/` correctly. I 
don't know if this affects other functionality though (like SPARK-11227) and we 
should check with @sarutak 


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to