Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-10-2020 08:02 AM
Hello,
I usually use pyspark to do such action. Some example code of how I write it to DBFS from a pyspark data frame:data_frame.coalesce(1).write.format("com.databricks.spark.csv").save("/FileStore/tables/your_file_name.csv")If you are curious how to transfer from straight SQL to pyspark, you can try creating a temporary table within SQL and then reading it into a pyspark data frame to then write it out. Below code is given you have imported the respective libraries.
%python
data_frame = spark.table("your_temp_table")
Please note I normally do not have export data of this size. You may need to research more the coalesce function and may be required to combine multiple csv files.