spark-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pwendell <>
Subject [GitHub] spark pull request: [SPARK-1100] prevent Spark from overwriting di...
Date Sat, 01 Mar 2014 02:18:59 GMT
Github user pwendell commented on a diff in the pull request:
    --- Diff: core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala ---
    @@ -712,6 +713,10 @@ class PairRDDFunctions[K: ClassTag, V: ClassTag](self: RDD[(K, V)])
         logDebug("Saving as hadoop file of type (" + keyClass.getSimpleName + ", " +
           valueClass.getSimpleName + ")")
    +    val path = new Path(conf.get("mapred.output.dir"))
    --- End diff --
    I'm not totally sure `mapred.output.dir` is going to be set always here. It might be safer
for this one to just only do it the format is a FileOutputFormat (e.g. check if the output
format is instanceof FileOutputFormat). Then get the path by casting it to a FileOutputFormat
and calling getOutputPath. That seems a bit safer to me.

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.

View raw message