title: Spark - Write DataFrame with custom file name
body: <p>I have a Spark (2.4) DataFrame that I want to write as a Pipe separated file. It should be pretty straightforward like so</p>
  <pre><code>val myDF = spark.table(&quot;mySchema.myTable&quot;)
  myDF.coalesce(1).write.format(&quot;csv&quot;).options(&quot;header&quot;, &quot;true&quot;).options(&quot;delimiter&quot;, &quot;|&quot;).save(&quot;/tmp/myDF&quot;)
  </code></pre>
  <p>I get a <code>part-*.csv</code> file in <code>/tmp/myDF</code>.</p>
  <p>So far, so good. But I actually want the file name to be something specific, e.g. <code>/tmp/myDF.csv</code></p>
  <p>But giving this String in <code>save</code> will just create a dir called <code>myDF.csv</code> and create the <code>part*.csv</code> file in there.</p>
  <p>Is there a way to write the DataFrame with a specific name?</p>