External access to views
External access to views through the Iceberg REST catalog is in Beta. Accessing views through the Unity REST API is generally available.
External engines can query Unity Catalog views using the following APIs:
- Unity REST API for views over Delta Lake tables.
- Iceberg REST catalog for views over Iceberg-compatible tables.
The external engine runs the view's SQL and reads the underlying tables. The reader must have access to the view and every referenced view or table.
Requirements
- Enable External data access for the metastore. See Enable external data access to Unity Catalog.
- Grant
USE CATALOGandUSE SCHEMAon the parent catalogs and schemas,SELECTon the view and every referenced view or table, andEXTERNAL USE SCHEMAon the schemas containing those tables. - Authenticate with a Databricks personal access token or OAuth token.
- Use view SQL that is compatible with the external engine.
Query views from Apache Spark
Minimum versions for the Spark examples:
- Apache Spark 4.0.
- For Delta views: Unity Catalog Spark connector 0.6.0 and Delta Lake 4.3.0.
- For Iceberg views: Apache Iceberg 1.10.0.
Use Unity Catalog catalog names as Spark catalog names, including for catalogs referenced by the view.
Views over Delta tables
Configure Spark using Access Databricks tables from Delta clients, with the Spark, Unity Catalog connector, and Delta Lake versions listed above.
To query the view, replace <catalog>, <schema>, and <view> with your catalog, schema, and view names, then run the following SQL in Spark:
SELECT * FROM <catalog>.<schema>.<view>;
Views over Iceberg tables
Configure Spark using Access Databricks tables from Apache Iceberg clients, with the Spark and Iceberg versions listed above.
To query the view, replace <catalog>, <schema>, and <view> with your catalog, schema, and view names, then run the following SQL in Spark:
SELECT * FROM <catalog>.<schema>.<view>;
Limitations
- Creating and altering views from external compute is unsupported.
- The external engine must support view definitions in the Spark SQL dialect. Queries that reference the view use the external engine's SQL dialect.
For Iceberg REST catalog access:
- Views with fine-grained access control policies, custom resolution paths, or user-defined functions are unsupported.
- Historical view versions are unsupported.
- Spark uses the reader's SQL settings. Results or errors can differ from Databricks Runtime.