Sub topic 5
Controlling who can use and manage a warehouse
This chapter assumes you can create a SQL warehouse and run queries in the SQL editor. It also assumes you know what users, groups, and workspace admins are. Here you will learn which permissions a warehouse has, who should get each one, and the errors people hit when they get it wrong.
Why warehouse permissions matter
A warehouse is compute. Anyone who can start it can spend money, and anyone who can edit it can change its size, scaling, and auto stop settings. Permissions on a warehouse are separate from permissions on data. Access to tables is governed by Unity Catalog. Access to the compute that reads those tables is governed by the warehouse's own access control list (ACL).
A user needs both to run a query. If either is missing, the query fails.
The warehouse permission levels
Each warehouse has an ACL. You can grant a level to a user, a group, or a service principal.
| Permission | What the holder can do |
|---|---|
| Can view | See the warehouse and its monitoring information. Cannot run queries on it. |
| Can use | Run queries on the warehouse. The warehouse starts automatically if it is stopped. |
| Can monitor | Use the warehouse and view its query history and monitoring details. |
| Can manage | Edit settings, start and stop it, delete it, and change its permissions. |
Levels are cumulative. Can manage includes everything below it. Workspace admins can manage every warehouse without being listed in the ACL.
Note that the level names in the interface can differ slightly between releases. Check the permissions dialog in your workspace.
Granting access
Open the warehouse in SQL Warehouses, choose Permissions, then search for a group or user and pick a level. Groups are preferable to individuals. When someone joins or leaves a team, you change group membership once instead of editing every warehouse.
Creating a new warehouse is a separate entitlement. A user needs the Databricks SQL access and Allow unrestricted cluster creation style entitlements, or a workspace admin to create it for them. Having Can use on an existing warehouse does not let someone create another one.
Who pays for a query
Queries run on the warehouse and use its compute. The cost accrues to the warehouse, not to the person who typed the query. A separate warehouse per team makes spending easy to attribute. A single shared warehouse is simpler but hides who caused the load.
Common errors
- The warehouse does not appear in the picker. The user has no permission on it. Grant Can use.
- The query fails with a permission error on a table, though the warehouse works. The warehouse ACL is fine. The user lacks
SELECTon the table, schema, or catalog in Unity Catalog. - A user can open the warehouse page but cannot run anything. They hold Can view only.
- Someone changed the size and the bill rose. Too many people hold Can manage. Reduce it to a small group.
Exercise
A new analyst can see the warehouse in the list and open its page, but every query fails to start. Which permission level do they likely have, and what is the smallest change that fixes it?
Show answer
They likely have Can view. Grant them Can use, preferably by adding them to a group that holds Can use. Do not grant Can manage.
Exercise
An analyst has Can use on the warehouse and gets a permission error on samples.nyctaxi.trips. Where do you fix it?
Show answer
In Unity Catalog, not on the warehouse. Grant the analyst or their group SELECT on the table, and the access needed on its parent schema and catalog.