How can I write my pyspark RDD's contents into a csv file. I am using the below code but it is not working :
df.saveAsTextFile(r'D:\asdf.csv')
How can I write my pyspark RDD's contents into a csv file. I am using the below code but it is not working :
df.saveAsTextFile(r'D:\asdf.csv')
Use the spark-csv package from Databricks: https://github.com/databricks/spark-csv
df.save('df.csv', 'com.databricks.spark.csv')