Skip to main content

Manage and work with foreign catalogs

A foreign catalog is a securable object in Unity Catalog that mirrors a database in an external data system. It lets you run read-only queries on that data system from your Databricks workspace, and manage access using Unity Catalog.

You work with a foreign catalog the same way you work with any catalog managed by Unity Catalog, with the differences described in the following table.

Task

Details

Reference

View foreign catalog details

Catalog Explorer shows the same details as standard Unity Catalog catalogs, plus the Connection used by the foreign catalog and the external database or catalog it mirrors.

View catalog details

Query data in a foreign catalog

You can run read-only queries on tables in a foreign catalog.

  • You must use Apache Spark data types in your queries. For a mapping of Spark data types to your external database data types, see the article for your connection type in the left navigation pane.
  • On dedicated access mode compute, you must own the underlying connection to query data in the foreign catalog. The CREATE FOREIGN CATALOG privilege on the connection isn't sufficient.
  • On standard access mode and serverless compute, standard catalog privileges apply.

Query data

Grant access to foreign tables

You grant read-only access to foreign tables using standard Unity Catalog privileges.

Manage privileges in Unity Catalog

View data lineage

Databricks tracks data lineage for tables in foreign catalogs the same way it tracks lineage for standard Unity Catalog tables.

Lineage in Unity Catalog

Create a foreign catalog

You create a foreign catalog as part of setting up a connection to an external data source. If you use the UI to create the connection, foreign catalog creation is included in that flow.

Create a foreign catalog

Task

Details

Reference

View foreign catalog details

Catalog Explorer shows the same details as standard Unity Catalog catalogs, plus the Connection used by the foreign catalog and the external database or catalog it mirrors.

View catalog details

Query data in a foreign catalog

You can run read-only queries on tables in a foreign catalog.

  • You must use Apache Spark data types in your queries. For a mapping of Spark data types to your external database data types, see the article for your connection type in the left navigation pane.
  • On dedicated access mode compute, you must own the underlying connection to query data in the foreign catalog. The CREATE FOREIGN CATALOG privilege on the connection isn't sufficient.
  • On standard access mode and serverless compute, standard catalog privileges apply.

Query data

Grant access to foreign tables

You grant read-only access to foreign tables using standard Unity Catalog privileges.

Manage privileges in Unity Catalog

View data lineage

Databricks tracks data lineage for tables in foreign catalogs the same way it tracks lineage for standard Unity Catalog tables.

Lineage in Unity Catalog

Create a foreign catalog

You create a foreign catalog as part of setting up a connection to an external data source. If you use the UI to create the connection, foreign catalog creation is included in that flow.

Create a foreign catalog