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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
pallavi_r
Super User
Super User

Writing dataframe to multiple lakshouse tables in spark notebook

Hi All,

 

How do we reference multiple lakehouse within a notebook. Can anyone please help me with sample code for writing data to another lakehouse Table within the workspace.
when I try this code, it gives me error - silver_zone is not defined. but i have created a lakehouse named silver_zone
df.write.format("delta").mode("overwrite") \ .saveAsTable('silver_zone.output_table_Silver')

Thanks,
Pallavi

1 ACCEPTED SOLUTION
TomMartens
Super User
Super User

Hey @pallavi_r ,

 

I assume that both lakehouses are in the same workspace as the notebook, then this is a strange message because this is my sample code:

# the default lakehouse of the notebook
df_asimpletable.write.mode("overwrite").format("delta").saveAsTable("df_asimpletable_new")

# another lakehouse but the same workspace
df_asimpletable.write.mode("overwrite").format("delta").saveAsTable('a_new_lakehouse.df_asimpletable_newer')

And it works perfectly.

 

Hopefully, this helps to tackle your challenge.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

1 REPLY 1
TomMartens
Super User
Super User

Hey @pallavi_r ,

 

I assume that both lakehouses are in the same workspace as the notebook, then this is a strange message because this is my sample code:

# the default lakehouse of the notebook
df_asimpletable.write.mode("overwrite").format("delta").saveAsTable("df_asimpletable_new")

# another lakehouse but the same workspace
df_asimpletable.write.mode("overwrite").format("delta").saveAsTable('a_new_lakehouse.df_asimpletable_newer')

And it works perfectly.

 

Hopefully, this helps to tackle your challenge.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

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 Solution Authors
Top Kudoed Authors