Forum Discussion
Msoede
1 year agoFrequent Visitor
Csv Python Fabric
Hi, Hopefully someone can help me out with the following. I want to create a csv file from a query in Fabric (being to big for Excel). Do I need to create such a csv with Python or are there othe...
- 1 year ago
Hello Msoede
Please give it a try:
df = spark.sql("YOUR SQL QUERY HERE")# Save the Spark DataFrame as a CSV file
df.write \
.option("header", "true") \
.option("delimiter", ",") \
.mode("overwrite") \
.csv("/lakehouse/default/Files/your_file_name.csv")
nilendraFabric
1 year agoSuper User
Hello Msoede
Please give it a try:
df = spark.sql("YOUR SQL QUERY HERE")
# Save the Spark DataFrame as a CSV file
df.write \
.option("header", "true") \
.option("delimiter", ",") \
.mode("overwrite") \
.csv("/lakehouse/default/Files/your_file_name.csv")