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

Be 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

Reply
Jy
Microsoft Employee
Microsoft Employee

Is LakeHouse required to run SparkSQL queries?

I have a notebook running with Spark SQL queries. I do not have a Lakehouse attached. Seeing the error "Spark SQL queries are only possible in the context of a lakehouse. Please attach a lakehouse to proceed" when trying to run the Spark SQL query. 

 

Are there options to run this without attaching the Lakehouse?

1 ACCEPTED SOLUTION
frithjof_v
Community Champion
Community Champion

Hi @Jy 

 

In my experience, you can use Spark SQL without attaching a Lakehouse to the Notebook.

 

I did it by using the abfss path to create a dataframe of my data.

 

Then I used this dataframe as the source to create a temporary view.

 

Then I could use the temporary view for doing Spark SQL.

 

https://community.fabric.microsoft.com/t5/Data-Engineering/Mounting-NB-on-the-fly/m-p/4057425/highli...

View solution in original post

2 REPLIES 2
frithjof_v
Community Champion
Community Champion

Hi @Jy 

 

In my experience, you can use Spark SQL without attaching a Lakehouse to the Notebook.

 

I did it by using the abfss path to create a dataframe of my data.

 

Then I used this dataframe as the source to create a temporary view.

 

Then I could use the temporary view for doing Spark SQL.

 

https://community.fabric.microsoft.com/t5/Data-Engineering/Mounting-NB-on-the-fly/m-p/4057425/highli...

v-huijiey-msft
Community Support
Community Support

Hi @Jy ,

 

Running Spark SQL queries in Fabric does require attaching lakehouse.

 

Unfortunately, there is no other option to run Spark SQL queries in Fabric Lakehouse notebooks without attaching a lakehouse.Lakehouse provides the necessary context and storage for executing these queries.

 

If you want to run Spark SQL queries, attach a Lakehouse.

 

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

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 MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.