spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shivaram <>
Subject [GitHub] spark pull request #16305: [SPARK-18895][TESTS] Fix resource-closing-related...
Date Fri, 16 Dec 2016 20:10:47 GMT
Github user shivaram commented on a diff in the pull request:
    --- Diff: core/src/main/scala/org/apache/spark/deploy/RPackageUtils.scala ---
    @@ -231,8 +236,10 @@ private[deploy] object RPackageUtils extends Logging {
         val zipOutputStream = new ZipOutputStream(new FileOutputStream(zipFile, false))
         try {
           filesToBundle.foreach { file =>
    -        // get the relative paths for proper naming in the zip file
    -        val relPath = file.getAbsolutePath.replaceFirst(dir.getAbsolutePath, "")
    +        // Get the relative paths for proper naming in the zip file. Note that
    +        // the separator should always be / for according to ZIP specification.
    +        // `relPath` here should be, for example, "/packageTest/def.R" or "/test.R".
    +        val relPath = file.toURI.toString.replaceFirst(dir.toURI.toString.stripSuffix("/"),
    --- End diff --
    Yeah I think using `/` always is good. Could you write a small comment on what the `toURI`
is accomplishing here (as opposed to the the `getAbsolutePath` we were using before)

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 or file a JIRA ticket
with INFRA.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message