Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2022 08:02 PM
Are you using Databricks on AWS, Azure or GCP?
If AWS, then you need to create an S3 bucket and mount that S3 bucket on dbfs location.
I'm assuming that customer table exists in your databricks account.
Next, run this code and it will write your df to S3 location.
Lastly, download the csv file from your S3 location to local.
df = spark.sql("select * from customers")
df.write.option("header",true).csv(<dbfs_path>)More about dbfs: here