March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi,
I am trying to access Fabric Datawarehouse table from Fabric notebooks. I am copying ABFS path of Datawarehouse table from its properties as under the hood table in datawarehouse is a delta table.
And then passed below query -
df = spark.read.format("delta").load("abfss://My workspace@onelake.dfs.fabric.microsoft.com/test_dw.Datawarehouse/Tables/dbo/Date")
df = spark.read.format("delta").load("abfss://My%20workspace@onelake.dfs.fabric.microsoft.com/test_dw.Datawarehouse/Tables/dbo/Date")
Just wondering is it possible to read and write to warehouse tables from notebooks in Fabric?
We have similar option in Synapse in which we can read/write data warehouse tables using .synapsesql option using Notebooks.
Solved! Go to Solution.
Hi @AndyDDC ,
Thanks for your answer. However, I was curious to try the query said above without any space in the workspace name. For that, I had to create new Fabric account as I don't have new workspace creation request in existing account. It took me a while, but I am able to read DW table from Spark notebook.
df = spark.read.format("delta").load("abfss://workspace-without-space@onelake.dfs.fabric.microsoft.com/test_dw.Datawarehouse/Tables/dbo/Date")
df.write is getting failed as it says PUT request forbidden.
However, It seems like overwrite or create new table in Warehouse using Spark Notebook is not possible as of now. Pyodbc and jdbc might help.
Hi @Madhusudan_P,
You can add the Warehouse as a shortcut to Lakehouse and then read it just as a table. But even in this method, you will be able to only read data from Warehouse and not write.
The approach I would suggest you is add the Lakehouse back in Warehouse and you would be able to query the data from Lakehouse within Warehouse. Kind of like a full circle.
You won't be able to read or write to Warehouse tables as those requests need to go through the SQL endpoint of the warehouse, it won't work with Spark.
You can use something like pyodbc or jdbc to connect to the Warehouse from within a notebook:
https://learn.microsoft.com/en-us/fabric/data-warehouse/connectivity
Hi @AndyDDC ,
Thanks for your answer. However, I was curious to try the query said above without any space in the workspace name. For that, I had to create new Fabric account as I don't have new workspace creation request in existing account. It took me a while, but I am able to read DW table from Spark notebook.
df = spark.read.format("delta").load("abfss://workspace-without-space@onelake.dfs.fabric.microsoft.com/test_dw.Datawarehouse/Tables/dbo/Date")
df.write is getting failed as it says PUT request forbidden.
However, It seems like overwrite or create new table in Warehouse using Spark Notebook is not possible as of now. Pyodbc and jdbc might help.
Hi @Madhusudan_P
That's correct, you cannot write directly to the warehouse folder. All updates have to come through the warehouse engine. You can't write to DW tables from Spark or any other engine .
Hi @v-nikhilan-msft
Since we have the capacity in Synapse Dedicated SQL Pool to write from Synapse notebook, why this hasn't been extended to Fabric Warehouse and Notebooks. Is it expected in future?
Dedicated SQL Pool connector for Apache Spark
Hi @Madhusudan_P
Currently we do not have any information regarding the availability of this feature.
Appreciate if you could share the feedback on our feedback channel. Which would be open for the user community to upvote & comment on. This allows our product teams to effectively prioritize your request against our existing feature backlog and gives insight into the potential impact of implementing the suggested feature.
Hope this helps. Please let me know if you have any further queries.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
8 | |
4 | |
2 | |
1 | |
1 |
User | Count |
---|---|
8 | |
6 | |
5 | |
4 | |
4 |