Error - Data Masking

FaizH
New Contributor III

Hi,

I was testing masking functionality of databricks and got the below error:

java.util.concurrent.ExecutionException: com.databricks.sql.managedcatalog.acl.UnauthorizedAccessException:
PERMISSION_DENIED: Query on table dev_retransform.uc_lineage.test_users_1
with row filter or column mask requires the SINGLE USER ACCESS privilege to be accessible from assigned clusters.

Below are the steps I followed in the notebook:

1. First I created this function

CREATE or REPLACE FUNCTION price_mask(price STRING)
  RETURN CASE WHEN is_member('HumanResourceDept') THEN price ELSE '***-**-****' END;
2. I created this table
CREATE TABLE test_users_1 (
  name STRING,
  price FLOAT MASK price_mask);
3. Before inserting any data, I executed this query select * from dev_retransform.uc_lineage.test_users_1, and got the error highlighted in the screenshot below.

Where I need to give access? When I create a table without this function, I don't get any error.


FaizH_0-1721187898699.png

 



szymon_dybczak
Esteemed Contributor III

Hi @FaizH , 

Are you using single user compute by any chance? 

Because of you do there is following limitation:

Single-user compute limitation

Do not add row filters or column masks to any table that you are accessing from a single-user cluster. During the public preview, you will be unable to access tables from a single user cluster if a filter or mask has been applied.

View solution in original post

FaizH
New Contributor III

Thanks for your reply. I use Access Mode as Shared instead of Single User for a cluster and it worked.