cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

Query table access control metadata from Databricks SQL

GabrieleMuciacc
New Contributor III

I'm trying to create a dashboard in Databricks SQL, parameterized by table name. We have a metadata table which contains the names of all the eligible tables, and we use it to populate a drop-down box for the dashboard. This is a simplified version of the query:

SELECT CONCAT(m.database_name, '.', m.table_name)
FROM metadata m

However, the drop-down box should only contain the tables that the current user has actually permission to read. So the question is: is it possible to modify the previous query to take permissions into account?

In other words, this is what I'm looking for (pseudo-code):

SELECT CONCAT(m.database_name, '.', m.table_name)
FROM metadata m
INNER JOIN permission_metadata p ON m.database_name = p.database_name AND m.table_name = p.table_name

where permission_metadata only contains the tables that the current user can read.

0 REPLIES 0
Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.