Forum Discussion
Using "Save As Table" Without having a default lakehouse
- 1 year ago
dbeavon3 In Fabric architecture, a notebook must be bound to a Lakehouse, therefore there is a default lakehouse attached to a notebook. As you correctly noticed, .saveAsTable() does not allow you to specify an abss path to the table on OneLake because it works with managed tables that are bound to a default lakehouse. If you have another lakehouse in your workspace or in a differrent workspace you can still save your data in a Delta table format but you'll need to use .save() wtih abss path which will create an external table in a target lakehouse.
In the code example below you can see that I have two lakehouses in a workspace, the Lakehouselab set as a default for the notebook. However I can succeefully save a dataframe into another non-default lakehouse with this technique.Unfortunately, you won't be able to use this external table in a lakehouse because it's currently not supported in Fabric (see this Solved: Re: External Tables in Fabric - Microsoft Fabric Community), so essentially, this entire exercise is useless. In a nutshell, external delta tables are not needed in Fabric because they can be replaced wiht a shortcut to an external data source.
However, your original question was about default lakehouse in a notebook, and the answer is yes, default lakehouse is absolutely necessary in Fabric. The default lakehouse can be reconfigured in a deployment pipeline when a notebook is moved to another workspace.
dbeavon3 In Fabric architecture, a notebook must be bound to a Lakehouse, therefore there is a default lakehouse attached to a notebook. As you correctly noticed, .saveAsTable() does not allow you to specify an abss path to the table on OneLake because it works with managed tables that are bound to a default lakehouse. If you have another lakehouse in your workspace or in a differrent workspace you can still save your data in a Delta table format but you'll need to use .save() wtih abss path which will create an external table in a target lakehouse.
In the code example below you can see that I have two lakehouses in a workspace, the Lakehouselab set as a default for the notebook. However I can succeefully save a dataframe into another non-default lakehouse with this technique.
Unfortunately, you won't be able to use this external table in a lakehouse because it's currently not supported in Fabric (see this Solved: Re: External Tables in Fabric - Microsoft Fabric Community), so essentially, this entire exercise is useless. In a nutshell, external delta tables are not needed in Fabric because they can be replaced wiht a shortcut to an external data source.
However, your original question was about default lakehouse in a notebook, and the answer is yes, default lakehouse is absolutely necessary in Fabric. The default lakehouse can be reconfigured in a deployment pipeline when a notebook is moved to another workspace.
- dbeavon31 year agoMemorable Member
I'll check out the shortcuts. Thanks for the pointer.
- v-priyankata1 year agoCommunity Support
Hi dbeavon3
Thank you for reaching out to the Microsoft Fabric Forum Community.
apturlov Thanks for the inputs. I hope the information provided by user was helpful. If you still have questions, please don't hesitate to reach out to the community.
Thank you for your understanding.- v-priyankata1 year agoCommunity Support
Hi dbeavon3
I wanted to check if you had the opportunity to review the information provided by user. Please feel free to contact us if you have any further questions.