title: How to write csv file into one file by pyspark
body: <p>I use <a href="https://stackoverflow.com/questions/31898964/how-to-write-the-resulting-rdd-to-a-csv-file-in-spark-python">this</a> method to write csv file. But it will generate a file with multiple part files. That is not what I want; I need it in one file. And I also found <a href="https://dzone.com/articles/spark-write-csv-file" rel="noreferrer">another post</a> using scala to force everything to be calculated on one partition, then get one file. </p>
  
  <p><strong>First question: how to achieve this in Python?</strong>  </p>
  
  <p>In the second post, it is also said a <code>Hadoop function</code> could merge multiple files into one. </p>
  
  <p><strong>Second question: is it possible merge two file in Spark?</strong></p>