Spark Write DataFrame to CSV File — SparkByExamples
sparkbyexamples.com › spark › spark-write-dataframeIn Spark/PySpark, you can save (write/extract) a DataFrame to a CSV file on disk by using dataframeObj.write.csv ("path"), using this you can also write DataFrame to AWS S3, Azure Blob, HDFS, or any Spark supported file systems. In this article I will explain how to write a Spark DataFrame as a CSV file to disk, S3, HDFS with or without header, I will also cover several options like compressed, delimiter, quote, escape e.t.c and finally using different save mode options.