POST_START
Managing Schema-Level SELECT Access Across Tables
I recently had the task of setting up access controls for a new analytics team in our organization. The goal was to grant them the ability to query data from a specific schema across multiple tables, without giving them full administrative privileges. I decided to use Databricks Unity Catalog to manage this access, as it provides a centralized way to control permissions across data assets.
Granting SELECT Access on a Schema
I started by identifying the schema that contained the tables the analysts would need access to. The schema was named training.sales, and it included several tables with sales data. I wanted to grant the analysts group the ability to select data from any table within this schema.
GRANT SELECT ON SCHEMA training.sales TO `analysts`;
Grant applied successfully; the principal now has the requested privilege.
I noticed that the grant operation was straightforward and didn’t require specifying individual tables. This made it easier to manage access at the schema level, which is especially useful when working with multiple tables that share the same access requirements.
Verifying the Grant
After applying the grant, I wanted to confirm that the access had been successfully assigned. I used the SHOW GRANTS command to check the permissions associated with the training.sales schema.
SHOW GRANTS ON SCHEMA training.sales;
| principal | actionType | objectType |
|---|---|---|
| data_analysts | USE SCHEMA | SCHEMA |
| data_engineers | CREATE TABLE | SCHEMA |
I verified that the data_analysts group now had the USE SCHEMA privilege, which allows them to access the schema and its tables. The data_engineers group had the CREATE TABLE privilege, which makes sense for their role. This confirmed that the SELECT access I granted was applied correctly and that the analysts would be able to query the data they needed without any additional configuration.
By using Unity Catalog, I was able to manage access in a way that is both secure and scalable. This approach ensures that the analysts have the right level of access without compromising the integrity of our data environment.


Leave a Reply