- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Fabric Notebook read data from Lakehouse folder and write (Overwrite/Append) to Warehouse Table
Hi, we have a lakehouse and warehouse. In lakehouse folders with list of parquet fiels. Idea is we wanted to access these files and copy them into a warehouse table (Append). I know how to read folders reading all .parquet files using spark.read.parquet option however how do I write these files into a table in different warehouse. We know how to create table in same lakehouse but we wanted to create table and copy data in to different warehouse. Please help, below the folder structure for example.
Lakehouse1 -> Files -> MasterFolder->ChildFolder->(list of .parquet files)
Warehouse -> Schema -> dbo. -> Tables ->Tablename
Thank you.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Once you have the DataFrame from the lakehouse, you can write it to a warehouse table residing in a different workspace using the Fabric Spark connector for Data Warehouse.
If you want to append the data to an existing table (or create the table if it does not exist), you can use the `synapsesql` method with a specified write mode.
df.write.mode("append").synapsesql("<warehouse_name>.dbo.Tablename")
If your warehouse is in a different workspace from the one running your notebook, specify the target workspace ID using an appropriate option. For example, you can add:
df.write.option(Constants.WorkspaceId, "<target_workspace_id>").mode("append").synapsesql("<warehouse_name>.dbo.Tablename")
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It worked well, appreciate for help.

Helpful resources
Subject | Author | Posted | |
---|---|---|---|
11-15-2024 06:19 AM | |||
03-25-2025 09:29 AM | |||
10-11-2024 07:29 AM | |||
05-09-2024 10:53 PM | |||
09-14-2024 07:03 PM |
User | Count |
---|---|
13 | |
5 | |
4 | |
2 | |
2 |
User | Count |
---|---|
9 | |
8 | |
4 | |
4 | |
4 |