Forum Discussion
Attach multiple lakehouse to a single notebook.
- 7 months ago
Hi V-yubandi-msft , sorry for coming back late on this, I was on leave and not feeling well. The issue is resolved now. Was able to attach multiple lakehouses to the notebook which resolved the issue
Hi KrishnaMoola ,
Are both of the lakehouses schema enabled?
May be this will help?
Lakehouse schemas in notebook
When you look at a schema enabled lakehouse in the notebook object explorer, you see tables are in schemas. You can drag and drop table into a code cell and get a code snippet that refers to the schema where the table is located. Use this namespace to refer to tables in your code: "workspace.lakehouse.schema.table". If you leave out any of the elements, the executor uses default setting. For example, if you only give table name, it uses default schema (dbo) from default lakehouse for the notebook.
Referencing nonschema lakehouses
When you set a schema-enabled lakehouse or no lakehouse as the default in your notebook, Spark code uses schema-enabled referencing for tables. However, you can still access lakehouses without enabled schemas within the same code by referencing them as "lakehouse.table."
Additionally, it’s possible to join tables from different types of lakehouses.
SQL
SELECT *
FROM workspace.schemalh.schema.table as schematable
INNER JOIN workspace.nonschemalh.table as nonschematable
ON schematable.id = nonschematable.id;
To help transition and refactor existing code to schema-enabled lakehouses, four-part naming is supported for lakehouses without schemas. You can reference tables as "workspace.lakehouse.dbo.table", where "dbo" serves as the schema name—even though it doesn’t exist yet in a lakehouse that isn’t schema-enabled. This approach lets you update your code with no downtime before enabling schema support in your lakehouses.
Hi there, I tried to attach my notebook to Silver lakehouse but still the tables in silver notebook are not recognised. I tried giving the workspace.lakehouse.schema.table but no luck.
Is there any other way ?