I am using Spark SQL for reading parquet and writing parquet file.
Spark SQL
But some cases,i need to write the DataFrame as text file instead of Json or
DataFrame
df.repartition(1).write.option("header", "true").csv("filename.csv")