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

    https://github.com/apache/spark/pull/11#discussion_r10191952
  
    --- Diff: core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala 
---
    @@ -712,6 +713,16 @@ class PairRDDFunctions[K: ClassTag, V: ClassTag](self: 
RDD[(K, V)])
         logDebug("Saving as hadoop file of type (" + keyClass.getSimpleName + 
", " +
           valueClass.getSimpleName + ")")
     
    +    if (outputFormatClass.isInstanceOf[FileOutputFormat[_, _]]) {
    +      val outputPath = conf.get("mapred.output.dir")
    --- End diff --
    
    So I looked into this more and it turns out the `fileSystem` parameter is 
totally ignored by FileOutputFormat. So I think we can just do this:
    
    ```
     if (outputFormatClass.isInstanceOf[FileOutputFormat[_, _]]) {
          // FileOutputFormat ignores the filesystem parameter
          val ignoredFs = FileSystem.get(conf)
          conf.getOutputFormat.checkOutputSpecs(ignoredFs, conf)
        }
    ```
    
    
http://grepcode.com/file/repo1.maven.org/maven2/org.jvnet.hudson.hadoop/hadoop-core/0.19.1/org/apache/hadoop/mapred/FileOutputFormat.java#FileOutputFormat.checkOutputSpecs%28org.apache.hadoop.fs.FileSystem%2Corg.apache.hadoop.mapred.JobConf%29


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

Reply via email to