Spark - How to write a single csv file WITHOUT folder? : <p>Suppose that <code>df</code> is a dataframe in Spark. The way to write <code>df</code> into a single CSV file is </p>

<p><code>df.coalesce(1).write.option("header", "true").csv("name.csv")</code></p>

<p>This will write the dataframe into a CSV file contained in a folder called <code>name.csv</code> but the actual CSV file will be called something like <code>part-00000-af091215-57c0-45c4-a521-cd7d9afb5e54.csv</code>. </p>

<p>I would like to know if it is possible to avoid the folder <code>name.csv</code> and to have the actual CSV file called <code>name.csv</code> and not <code>part-00000-af091215-57c0-45c4-a521-cd7d9afb5e54.csv</code>. The reason is that I need to write several CSV files which later on I will read together in Python, but my Python code makes use of the actual CSV names and also needs to have all the single CSV files in a folder (and not a folder of folders).</p>

<p>Any help is appreciated.</p>
