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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
tkiwi
Helper I
Helper I

Spark Temp View with two Lakehouses

Hey there, I`ve got the following situation

Notebook with SparkSQL, the following SELECT is running

SELECT * FROM LH1.dbo.table1 t1 
JOIN LH2.dbo.table2 t2 
ON t1.columnID = t2.columnID

The following statement is also running

CREATE OR REPLACE TEMP VIEW tmp_select AS
SELECT * FROM LH1.dbo.table1 t1 
JOIN LH2.dbo.table2 t2
ON t1.columnID = t2.columnID  

But if I want to select this generated temporary View I get the following error:

[REQUIRES_SINGLE_PART_NAMESPACE] spark_catalog requires a single-part namespace, but got \LH1`.`dbo`.`

What I am doing wrong here?

P.S. Both Lakehouses are connected with my notebook and have schema enabled.

1 ACCEPTED SOLUTION
tkiwi
Helper I
Helper I

2 REPLIES 2
smpa01
Super User
Super User

@tkiwi  temporary views in spark are session-scoped; meaning they are short lived and don't exists beyond the scope of the query. If you are expecting to create a view with the hope that it shows up in table section of lakehouse tables, that is not the intended use of the TEMPORRY VIEW

 

fabric notebook has full support for them; try the following

spark.sql("create or replace temporary view temp_view_1 as select 1 as colA")
df = spark.sql(f"select * from temp_view_1")
df.show()

 

 

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
tkiwi
Helper I
Helper I

Found a reason by another post on reddit...Spark views are currently not supported:

https://learn.microsoft.com/en-us/fabric/data-engineering/lakehouse-schemas#public-preview-limitatio...

Helpful resources

Announcements
November Fabric Update Carousel

Fabric Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors