thinQmaster Virtual testing partner Adaptive practice exams that find your weak spots and drill them. Every answer explained. From $69
Enroll

thinQmaster

Find your exam

Five questions free, before you decide.

Step 1 · choose a vendor

In one of our camps? Your practice exams come with the tuition — they are on your study page already.

Data & Analytics · Intermediate

Masking Policy

A Snowflake Enterprise schema-level object that dynamically masks column values at query time based on conditions such as the current role.

Definition

Masking policies are applied to columns or, through tag-based masking, to all columns with a tag. They support full, partial and hashed masking, while the stored data is unchanged. External tokenization can call external functions to detokenize.

Example

CREATE MASKING POLICY ssn_mask AS (v STRING) RETURNS STRING -> CASE WHEN CURRENT_ROLE() IN ('HR') THEN v ELSE '***-**-' || RIGHT(v,4) END;

Exam tip

Masking policy = column-level protection; row access policy = row-level filtering.

Related terms