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

    https://github.com/apache/spark/pull/18971#discussion_r134633585
  
    --- Diff: 
core/src/test/scala/org/apache/spark/scheduler/ReplayListenerSuite.scala ---
    @@ -151,7 +153,10 @@ class ReplayListenerSuite extends SparkFunSuite with 
BeforeAndAfter with LocalSp
        * assumption that the event logging behavior is correct (tested in a 
separate suite).
        */
       private def testApplicationReplay(codecName: Option[String] = None) {
    -    val logDirPath = Utils.getFilePath(testDir, "test-replay")
    +    val logDir = new File(testDir.getAbsolutePath, "test-replay")
    +    // Here, it creates `Path` from the URI instead of the absolute path 
for the explicit file
    +    // scheme so that the string representation of this `Path` has leading 
file scheme correctly.
    +    val logDirPath = new Path(logDir.toURI)
    --- End diff --
    
    I have Windows one set up properly for dev env. So, it is not really a big 
deal to test. I am fine with asking more cases in the future.
    
    ```scala
    println("=== org.apache.spark.util.Utils.resolveURI")
    println(Utils.resolveURI("C:\\WINDOWS").toString)
    println(Utils.resolveURI("/C:/WINDOWS").toString)
    println(Utils.resolveURI("C:/WINDOWS").toString)
    println
    println(Utils.resolveURI("C:\\WINDOWS").getScheme)
    println(Utils.resolveURI("/C:/WINDOWS").getScheme)
    println(Utils.resolveURI("C:/WINDOWS").getScheme)
    println
    
    println("=== java.io.File")
    println(new File("C:\\WINDOWS").toURI.toString)
    println(new File("/C:/WINDOWS").toURI.toString)
    println(new File("C:/WINDOWS").toURI.toString)
    println
    println(new File("C:\\WINDOWS").toURI.getScheme)
    println(new File("/C:/WINDOWS").toURI.getScheme)
    println(new File("C:/WINDOWS").toURI.getScheme)
    println
    
    println("=== org.apache.hadoop.fs.Path")
    println(new Path("C:\\WINDOWS").toUri.toString)
    println(new Path("/C:/WINDOWS").toUri.toString)
    println(new Path("C:/WINDOWS").toUri.toString)
    println
    println(new Path("C:\\WINDOWS").toString)
    println(new Path("/C:/WINDOWS").toString)
    println(new Path("C:/WINDOWS").toString)
    println
    println(new Path("C:\\WINDOWS").toUri.getScheme)
    println(new Path("/C:/WINDOWS").toUri.getScheme)
    println(new Path("C:/WINDOWS").toUri.getScheme)
    println
    
    println("=== java.io.File.toURI and org.apache.hadoop.fs.Path")
    println(new Path(new File("C:\\WINDOWS").toURI).toUri.toString)
    println(new Path(new File("/C:/WINDOWS").toURI).toUri.toString)
    println(new Path(new File("C:/WINDOWS").toURI).toUri.toString)
    println
    println(new Path(new File("C:\\WINDOWS").toURI).toString)
    println(new Path(new File("/C:/WINDOWS").toURI).toString)
    println(new Path(new File("C:/WINDOWS").toURI).toString)
    println
    println(new Path(new File("C:\\WINDOWS").toURI).toUri.getScheme)
    println(new Path(new File("/C:/WINDOWS").toURI).toUri.getScheme)
    println(new Path(new File("C:/WINDOWS").toURI).toUri.getScheme)
    ```
    
    produced
    
    ```
    === org.apache.spark.util.Utils.resolveURI
    file:/C:/WINDOWS/
    file:/C:/WINDOWS/
    C:/WINDOWS
    
    file
    file
    C
    
    === java.io.File
    file:/C:/WINDOWS/
    file:/C:/WINDOWS/
    file:/C:/WINDOWS/
    
    file
    file
    file
    
    === org.apache.hadoop.fs.Path
    /C:/WINDOWS
    /C:/WINDOWS
    /C:/WINDOWS
    
    C:/WINDOWS
    C:/WINDOWS
    C:/WINDOWS
    
    null
    null
    null
    
    === java.io.File.toURI and org.apache.hadoop.fs.Path
    file:/C:/WINDOWS/
    file:/C:/WINDOWS/
    file:/C:/WINDOWS/
    
    file:/C:/WINDOWS/
    file:/C:/WINDOWS/
    file:/C:/WINDOWS/
    
    file
    file
    file
    ```


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