Symptom
A view in Unity Catalog, for example main.reporting.v_orders, behaves differently depending on who runs it and where:
- Analysts on a SQL warehouse can query it. A data engineer on their own cluster gets
INSUFFICIENT_PERMISSIONS ... User does not have SELECT on Table 'main.raw.orders', which names the underlying table, not the view. - The view worked for everyone yesterday. Today it fails for everyone, and nobody changed the grants on the view.
- A dynamic view returns no rows, or masked values, for people who should see the data.
- A table gained a column, but
SELECT *from the view doesn't show it. Or a column was renamed and the view now fails to resolve.
The error text varies by runtime. Look at which object it names, the view or a table underneath it, because that tells you which privilege check failed.
How Unity Catalog checks a view
Two separate checks run when someone queries a view:
- The reader needs
USE CATALOGandUSE SCHEMAon the view's catalog and schema, plusSELECTon the view itself. - The view owner needs
SELECTon every table and view the definition references, plusUSE CATALOGandUSE SCHEMAon their parents. This runs at query time, not when the view is created.
Readers don't need access to the underlying tables. That is the point of the view. Two exceptions break that rule: dedicated compute on older runtimes, and dedicated compute that can't reach serverless filtering.
| Symptom | Likely cause | Fix |
|---|---|---|
| Fails for everyone, error names an underlying table | Owner lost SELECT or USE SCHEMA on a source, or the owner principal was removed | Re-grant to the owner, or transfer ownership to a group |
| Fails only on dedicated (single user) clusters, names an underlying table | DBR 15.3 or below, where the reader needs SELECT on every referenced table | Use DBR 15.4 LTS+ with serverless enabled, or standard access mode |
| Fails on dedicated DBR 15.4+ with a network or timeout error | Filtering can't reach serverless compute (firewall, serverless not enabled) | Enable serverless for the workspace and open the required ports |
| Fails only in one workspace | A referenced catalog isn't bound to that workspace | Bind the catalog or move the view |
| Dynamic view hides data from the right people | is_member() checks workspace-local groups | Use is_account_group_member() |
New columns missing from SELECT * view | The view's column list was fixed when it was created | ALTER VIEW ... AS or WITH SCHEMA EVOLUTION |
| Column resolution error after a rename or drop | Definition references a column that no longer exists | Rewrite the view definition |
Check 1: who owns the view, and what does it reference?
DESCRIBE TABLE EXTENDED main.reporting.v_orders;
Read the Owner and View Text rows. You can also pull every view in a schema with its definition:
SELECT table_catalog, table_schema, table_name, view_definition
FROM main.information_schema.views
WHERE table_schema = 'reporting';
Now check the owner's grants on each referenced object:
SHOW GRANTS ON TABLE main.raw.orders;
SHOW GRANTS ON SCHEMA main.raw;
SHOW GRANTS ON CATALOG main;
Warning
SHOW GRANTSlists grants made to principals directly. If the owner gets access through a group, find that group in the output and confirm the owner is still a member. If someone removed them from the group in Entra ID and SCIM synced the change, every view they own breaks at once.
The usual root causes
- The view was created by an individual, and that person left. Their account was deactivated, or they were taken out of the group that held
SELECTon the source. - Someone tightened grants on the
rawschema and removed the engineer's access without realising they owned downstream views. - A Terraform or bundle deploy replaced the full grant list on a source schema. See the related post on Terraform revoking grants.
Fix: grant to the owner, or make a group the owner
The quick fix is to restore the missing privilege. The durable fix is to have a group own the view, not a person:
ALTER VIEW main.reporting.v_orders OWNER TO `reporting-owners`;
GRANT USE CATALOG ON CATALOG main TO `reporting-owners`;
GRANT USE SCHEMA ON SCHEMA main.raw TO `reporting-owners`;
GRANT SELECT ON TABLE main.raw.orders TO `reporting-owners`;
You must own the view or be a metastore admin to change its owner. Check what else the departed user owns:
SELECT table_catalog, table_schema, table_name, table_type, table_owner
FROM system.information_schema.tables
WHERE table_owner = 'jane.doe@contoso.com';
Check 2: what compute is the failing user on?
Ask for the cluster ID, or open the run, and check the access mode and runtime:
databricks clusters get 0123-456789-abcdefgh --output json \
| jq '{data_security_mode, spark_version}'
SINGLE_USER (dedicated) or DATA_SECURITY_MODE_DEDICATED means dedicated access mode. Names vary by API version, so check your output.
On dedicated compute:
- DBR 15.3 and below: to read any view, the user must have
SELECTon every table and view it references. Dynamic views and tables with row filters or column masks can't be read at all. - DBR 15.4 LTS and above: reads of views over tables the user can't
SELECT, plus dynamic views, row filters, column masks, materialized views and streaming tables, are handed to the workspace's serverless compute for filtering. Writes to those objects need DBR 16.3 or above.
For 15.4+ filtering to work:
- Serverless compute must be enabled for the workspace.
- If the workspace has outbound firewall rules, the compute must reach the serverless filtering service. Microsoft's docs list ports 8443 to 8451. Check the current page for your setup.
- The serverless filtering work is billed separately. It shows up in
system.billing.usageas serverless usage.
Tip
If you can't enable serverless yet, move the user to a standard access mode cluster or a SQL warehouse. Both enforce view permissions natively. Don't hand out
SELECTon raw tables just so a view works on an old single user cluster. That defeats the view.
Streaming reads from tables with row filters or column masks are limited on dedicated compute. Check the current limitations page before you move a streaming job.
Check 3: does the failing workspace see every referenced catalog?
A view in main that joins finance.ref.cost_centres only works in a workspace where finance is bound. Run this in the failing workspace:
SHOW CATALOGS;
If a referenced catalog is missing, the catalog is ISOLATED and not bound to this workspace. Either add a binding (read-only is enough) or keep cross-catalog views inside workspaces that see both.
Check 4: dynamic views use the right group function
CREATE OR REPLACE VIEW main.reporting.v_orders_secure AS
SELECT
order_id,
region,
CASE WHEN is_account_group_member('finance-readers') THEN amount ELSE NULL END AS amount
FROM main.raw.orders
WHERE is_account_group_member('global-sales')
OR region = 'EMEA';
is_member() checks workspace-local groups. Unity Catalog groups are account groups, so a user can be in the right Entra ID group and still fail an is_member() check. Use is_account_group_member(). Test as an affected user, or check membership from the account console.
Caution
To change an existing production view, use
ALTER VIEW ... ASrather than dropping and recreating it. A recreated view can come back with a new owner (you) and without its grants, and every reader loses access. Before you deploy, confirm the owner canSELECTfrom everything the new definition references.
Check 5: schema drift under the view
When the view is created, SELECT * is expanded to a fixed column list:
- New source columns don't appear until you redefine the view.
- Renamed or dropped columns make the view fail to resolve.
Refresh the view but keep its grants:
ALTER VIEW main.reporting.v_orders AS
SELECT * FROM main.raw.orders;
On Databricks Runtime 15.3 and above and current SQL warehouses, you can let the view follow source changes:
ALTER VIEW main.reporting.v_orders WITH SCHEMA EVOLUTION;
Use schema evolution for convenience views. For views that external consumers or BI semantic models depend on, keep an explicit column list. A silent new column can break their contract.
Before renaming or dropping a source column, find the views that depend on it:
SELECT table_catalog, table_schema, table_name
FROM system.information_schema.views
WHERE view_definition ILIKE '%raw.orders%';
Prevent it next time
- Have groups own production views, never individuals. Make ownership transfer part of your leaver checklist.
- Grant source-table access to the owning group in code, in the same Terraform or bundle module that creates the view.
- Standardise on standard access mode, SQL warehouses or DBR 15.4 LTS+ dedicated compute with serverless enabled. Use a compute policy to block older runtimes.
- Use
is_account_group_member()in every dynamic view and row filter. Add a lint check foris_member(in CI. - Run the
information_schema.viewsdependency query before any column rename, drop or grant change on a source schema.
Get the weekly HubDatAI email
One email a week with everything new: posts, learning sessions and videos. Free, no spam, unsubscribe in one click. What you get