Classification SQL Reference

This topic describes the various SQL constructs that you can use to extract classification categories and apply them as tags to tables, views, and columns.

In this Topic:

Required Access Control Privileges

To classify data in a table or view, the role used to classify the data must have the following privileges:

  • IMPORTED PRIVILEGES privilege on the SNOWFLAKE read-only shared database (required for applying tags).

  • SELECT privileges on the table/view, as well as the USAGE privilege on the database and schema where the table/view is located.

    For more details, see Access Control Privileges.

  • Classification utilizes tags, which means the appropriate tagging privileges are required to perform certain classification tasks.

    For example, the APPLY TAG global privilege is required to enable applying classification tags to table/view columns.

    For more details, see Managing Tags.

Functions, Stored Procedures, and Views

Snowflake provides the following functions and stored procedures for classifying data:

In addition, the following object tagging functions and views can be used for viewing and tracking the applied tags:

  • TAG_REFERENCES view (in Account Usage): Shows classification tags for all or specified columns. Note that the latency for the view may be up to 120 minutes.

  • TAG_REFERENCES table function (in Information Schema): Returns the classification tags for a specified column.

  • TAG_REFERENCES_ALL_COLUMNS table function (in Information Schema): Returns the classification tags on all columns for a specified table.

  • SYSTEM$GET_TAG function: Return the tag value for a specified tag associated with a column.

Category Tag Values and Mappings

PRIVACY_CATEGORY Tag Values

SEMANTIC_CATEGORY Tag Values

IDENTIFIER

  • EMAIL

  • IBAN

  • IMEI

  • IP_ADDRESS

  • VIN

  • NAME

  • PAYMENT_CARD

  • PHONE_NUMBER (US numbers only)

  • URL

  • US_BANK_ACCOUNT

  • US_DRIVERS_LICENSE

  • US_PASSPORT

  • US_SSN

  • US_STREET_ADDRESS

QUASI_IDENTIFIER

  • AGE

  • GENDER

  • COUNTRY

  • DATE_OF_BIRTH

  • ETHNICITY

  • LATITUDE

  • LAT_LONG

  • LONGITUDE

  • MARITAL_STATUS

  • OCCUPATION

  • US_POSTAL_CODE

  • US_STATE_OR_TERRITORY

  • US_COUNTY

  • US_CITY

  • YEAR_OF_BIRTH

SENSITIVE

  • SALARY

Back to top