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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
yongshao
Helper III
Helper III

How to access another lakehouse delta table from pyspark when enabling lakehouse schemas feature

When creating a new lakehouse, check "lakehouse schemas" option

create a new pyspark notebook with the lakehouse 

from the notebook, how to access a delta table in another lakehouse (both lakehouses in same workspace)?

 

the following code used to work fine, but when the default lakehouse has "schemas" preview feature, it no longer works

df = spark.table("another_lakehouse_name.table_name")

 

1 ACCEPTED SOLUTION
yongshao
Helper III
Helper III

4 REPLIES 4
mathewthewise
Frequent Visitor

I did some testing.

My final simplified conclusion is: when in Notebook connected to multiple lakehouses (some with some without schema), make the DEFAULT LH one with schema.

Then I can refer to all others using WSNAME.LHNAME.SCHEMA.TABLE.
Note that LHs without schema use dbo as kind of a placeholder for their schema but still seem to need it atm.

Also setting DEFAULT LH to one without schema causes all the troubles.

yongshao
Helper III
Helper III

Found out the cause - another lakehouse schemas feature should also be turned on

https://community.fabric.microsoft.com/t5/Data-Engineering/Cannot-Cross-workspace-Spark-SQL-queries-...

yongshao
Helper III
Helper III

Hello @nilendraFabric 

df = spark.table("your_workspace_name.another_lakehouse_name.schema_name.table_name")

got the error AnalysisException: [REQUIRES_SINGLE_PART_NAMESPACE] spark_catalog requires a single-part namespace

nilendraFabric
Super User
Super User

 

hello @yongshao 

 

To access Delta tables across lakehouses with the schemas feature enabled in Fabric notebooks, you must use fully qualified namespace references.

 

df = spark.table("your_workspace_name.another_lakehouse_name.schema_name.table_name")

 

If this helps please accept the answer 

 

Helpful resources

Announcements
Fabric July 2025 Monthly Update Carousel

Fabric Monthly Update - July 2025

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

July 2025 community update carousel

Fabric Community Update - July 2025

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