Forum Discussion
Fabric Notebook Outputs to Azure SQL Database or CSV file?
- Anonymous2 years ago
Hi GlassShark1
Thanks for using Fabric Community.Fabric is a powerful platform that can be used for a variety of tasks, including data engineering, data science, and machine learning. Fabric Notebooks are a primary tool for developing Apache Spark jobs and machine learning experiments. They provide a web-based interactive surface used by data scientists and data engineers to write code, benefiting from rich visualizations and Markdown text.
How to use notebooks - Microsoft Fabric | Microsoft LearnRegarding your questions about saving outputs:
Saving output as a table in a Lakehouse:
You’re correct that you can save an output as a table in a Lakehouse using the delta format. If you want to save the data in a different format, such as csv, you can indeed change "delta" to "csv" in your code. However, please note that when saving as csv, Spark will always save to a folder because it uses partitions to read and write files. So you save the data into a CSV file in the Files folder.
python - Write to a CSV file using Microsoft Fabric - Stack Overflow
Load data into your lakehouse with a notebook - Microsoft Fabric | Microsoft Learn
Writing the output back as a SQL view or table in Azure Database:
It’s possible to write the output back to a SQL view or table in your traditional Azure Database. You can use copy data activity in Fabric to acheive this.
https://learn.microsoft.com/en-us/fabric/data-factory/copy-data-activity
Below are the available destinations for copy data:
Downloading or saving outputs like csvs in directories:
If you want to download the CSV files or any other files present in lakehouse, you can use Onelake explorer in Fabric.Access Fabric data locally with OneLake file explorer - Microsoft Fabric | Microsoft Learn
Download the latest version of Onelake explorer and sync the Lakehouse.
You can also refer to this thread:
Solved: save data in excel - Microsoft Fabric Community
Hope this helps. Please let me know if you have any further questions.
Hi GlassShark1
Thanks for using Fabric Community.
Fabric is a powerful platform that can be used for a variety of tasks, including data engineering, data science, and machine learning. Fabric Notebooks are a primary tool for developing Apache Spark jobs and machine learning experiments. They provide a web-based interactive surface used by data scientists and data engineers to write code, benefiting from rich visualizations and Markdown text.
How to use notebooks - Microsoft Fabric | Microsoft Learn
Regarding your questions about saving outputs:
Saving output as a table in a Lakehouse:
You’re correct that you can save an output as a table in a Lakehouse using the delta format. If you want to save the data in a different format, such as csv, you can indeed change "delta" to "csv" in your code. However, please note that when saving as csv, Spark will always save to a folder because it uses partitions to read and write files. So you save the data into a CSV file in the Files folder.
python - Write to a CSV file using Microsoft Fabric - Stack Overflow
Load data into your lakehouse with a notebook - Microsoft Fabric | Microsoft Learn
Writing the output back as a SQL view or table in Azure Database:
It’s possible to write the output back to a SQL view or table in your traditional Azure Database. You can use copy data activity in Fabric to acheive this.
https://learn.microsoft.com/en-us/fabric/data-factory/copy-data-activity
Below are the available destinations for copy data:
Downloading or saving outputs like csvs in directories:
If you want to download the CSV files or any other files present in lakehouse, you can use Onelake explorer in Fabric.
Access Fabric data locally with OneLake file explorer - Microsoft Fabric | Microsoft Learn
Download the latest version of Onelake explorer and sync the Lakehouse.
You can also refer to this thread:
Solved: save data in excel - Microsoft Fabric Community
Hope this helps. Please let me know if you have any further questions.