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
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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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