spark-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pwendell <...@git.apache.org>
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:

    https://github.com/apache/spark/pull/11#discussion_r10188570
  
    --- 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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message