I created a masking policy for PII data. I then applied it to a table like so:
CREATE TABLE EXAMPLE.EXAMPLE_TABLE
(ID INT,
LAST_NAME STRING,
PHONE_NUMBER INT);
ALTER TABLE EXAMPLE.EXAMPLE_TABLE MODIFY COLUMN LAST_NAME SET MASKING POLICY PUBLIC.PII_MASK_STRING;
ALTER TABLE EXAMPLE.EXAMPLE_TABLE MODIFY COLUMN PHONE_NUMBER SET MASKING POLICY PUBLIC.PII_MASK_NUMERIC;
Now I want to be able to reverse engineer a DDL script like this with the ALTER TABLE... SET MASKING POLICY
included.
Is there a way to query for the list of columns that have masking policies applied to them (and which mask it uses)?
EDIT: For this case, the user has ownership of the table but not the masking policy. what permissions are required to query this information?