Last active
February 9, 2019 20:28
-
-
Save Zifah/2a9c7b26b5925fe9ca3b080f6c3faefa to your computer and use it in GitHub Desktop.
Write a Spark dataframe to an Azure blob storage container mounted on Databricks filesystem
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mount_name = "/mnt/financial_survey_data" | |
write_path = "%s/wrangled_data_folder" % mount_name | |
(dataframe | |
# .coalesce(1) # uncomment this line to ensure that the data is written to just one file | |
.write | |
.option("header", "true") | |
.mode("overwrite") # overwrite any pre-existing data at the path that we're writing to | |
.csv(write_path) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment