title: rdd.saveAsTextFile doesn't seem to work, but repetitions throw FileAlreadyExistsException
body: <p>I'm running <code>dataFrame.rdd.saveAsTextFile("/home/hadoop/test")</code> in an attempt to write a data frame to disk. This executes with no errors, but the folder is not created. Furthermore, when I run the same command again (in the shell) an Exception is thrown: </p>
  
  <pre><code>org.apache.hadoop.mapred.FileAlreadyExistsException: Output directory hdfs://ip-xxx-xx-xx-xx.ec2.internal:8020/home/hadoop/feet already exists
  </code></pre>
  
  <p>Any idea why this is? Is there a nuance of the submission move (client, cluster) that affects this?</p>
  
  <p>EDIT:</p>
  
  <p>I have permission to create directories in <code>/home/hadoop</code> but I cannot create directories inside any of the dirs/sub-dirs created by <code>rdd.saveAsTextFile("file:/home/hadoop/test")</code>. The structure looks like this:</p>
  
  <p><code>/home/hadoop/test/_temporary/0</code></p>
  
  <p>How are <code>_temporary</code> and <code>0</code> being created if I do not have permission to create directories inside <code>test</code> from the command line? Is there a way to change the permission of these created directories?</p>
  
  <p>Edit2:</p>
  
  <p>In the end I wrote to s3 instead using <code>rdd.coalesce(1).saveAsTextFile("s3://...")</code>. This is only viable if you have a very small output - because <code>coalesce(n)</code> will cause the RDD to exist and be processed further on only n workers. In my case, I chose 1 worker so that the file would be generated by one worker. This gave me a folder containing one <code>part-00000</code> file which had all of my data.</p>