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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.