Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at the 2025 Microsoft Fabric Community Conference. March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for $400 discount. Register now

Reply
smpa01
Super User
Super User

Spark Connector Issue

I am constatntly getting errors when I am trying the following in a notebook (Prod_dw.dbo.factSales is the 3 part name of a Fabric data warehouse table). This notebook is mounted to a lakehouse and DW is not shortcuted to lakehouse.

 

smpa01_0-1721617731574.png

following the Spark Connector documentation (The doc does not mention any shortcuting of DW to LH as a pre req)

 

smpa01_1-1721617825716.png

 

Do you know how can I debug this?

 

 

 

Thank you in advance.

 

 

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
8 REPLIES 8
smpa01
Super User
Super User

Can someone please shed some light on this topic as to how can I debug this connector?

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
frithjof_v
Super User
Super User

Is your notebook's default Lakehouse in the same workspace as the Prod_dw?

 

If not, or if your notebook doesn't have a default Lakehouse (look for the pin symbol), then I guess that could be the reason.

 

Have you tried to use the following code for reading data across workspaces (I guess it could work also within the same workspace):

 

https://learn.microsoft.com/en-us/fabric/data-engineering/spark-data-warehouse-connector#read-data-a...

Is your notebook's default Lakehouse in the same workspace as the Prod_dw? - yes

 

if not, or if your notebook doesn't have a default Lakehouse (look for the pin symbol), - yes ; I already mentioned that that notebook is mounted to a lakehouse (LH resides in the same WS as DW)

 

Have you tried to use the following code for reading data across workspaces - yes, gives following error

: value synapsesql is not a member of org.apache.spark.sql.DataFrameReader

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

I tried myself now, and I am getting the following error:

 

Request to read failed. Reason - HTTP request forbidden.
com.microsoft.spark.fabric.tds.error.FabricSparkTDSInternalAuthError: HTTP request forbidden.

 

 

So I am not able to use it myself either.
But to be honest I don't have experience with Scala, so perhaps I did something wrong in my code, I don't know. I tried to follow this page: Spark connector for Microsoft Fabric Synapse Data Warehouse - Microsoft Fabric | Microsoft Learn

 

I used this code:

 

Cell 1 (runs fine)

 

%%spark
import com.microsoft.spark.fabric.tds.implicits.read.FabricSparkTDSImplicits._
import org.apache.spark.sql.functions._

 

 

Cell 2 (gives the error when I run this cell)

 

%%spark
val df = spark.read.synapsesql("TestWarehouse.dbo.customer_dimension")

 

 

I also tried this

Cell 3 (gives the same error when I run this cell)

 

%%spark
import com.microsoft.spark.fabric.Constants
val df = spark.read.option(Constants.WorkspaceId, "550e8400-e29b-41d4-a716-446655440000").synapsesql("testwarehouse.dbo.customer_dimension")

 

 

 

This is my table in the Fabric Warehouse. It's in the same workspace as the Lakehouse which is the Default lakehouse of my Notebook.

So this is the table I am trying to read in a Notebook by using the Spark connector for Microsoft Fabric Synapse Data Warehouse, but I am getting the error message as mentioned above.

 

frithjof_v_0-1721658083678.png

 

I am the user who created (and therefore also admin) of the workspace, the lakehouse and the warehouse.

Did you manage to get this to work? I'm running into the same errors with the same setup.

I did not make any progress, let me know if you make any. I wonder if MS is yet to ship this.

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
Luuk_J
Frequent Visitor

Well, I tried again and everything seems to work fine now 😀
I guess they fixed it, tried restarting sessions and it still works.

The statements in my notebook:

Luuk_J_1-1724401776198.png

Luuk_J
Frequent Visitor

Too bad, I will keep you updated!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebFBC_Carousel

Fabric Monthly Update - February 2025

Check out the February 2025 Fabric update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.