ASSOCIATE_SEMANTIC_CATEGORY_TAGS¶
Takes the results of the EXTRACT_SEMANTIC_CATEGORIES function on a table/view and applies the results as tags on the supported columns in the table/view.
Before calling this stored procedure, you should first execute the EXTRACT_SEMANTIC_CATEGORIES function on the table/view and determine whether you are satisfied with the results generated by the classification algorithm.
Syntax¶
ASSOCIATE_SEMANTIC_CATEGORY_TAGS( '<object_name>' , <category_extraction_result> )
Arguments¶
object_name
The name of the table, external table, view, or materialized view containing the columns to be classified. If a database and schema are not in use in the current session, the name must be fully-qualified.
The name must be specified exactly as it is stored in the database. If the name contains special characters, capitalization, or blank spaces, the name must be enclosed first in double-quotes and then in single quotes.
category_extraction_result
The result from executing the EXTRACT_SEMANTIC_CATEGORIES function on the same table/view.
Usage notes¶
Globally-defined stored procedures utilize caller’s rights. For more details, see Understanding caller’s rights and owner’s rights stored procedures.
The function applies the Classification system tags from the top level of the classification results returned by the EXTRACT_SEMANTIC_CATEGORIES function. Alternate values are not applied.
If you want to apply alternate values:
You can store the classification results in a table and edit the results before applying them or
Apply the values manually using ALTER TABLE … MODIFY COLUMN … SET TAG.
To unset a Classification system tag from a column, use an ALTER TABLE … MODIFY COLUMN … UNSET TAG statement.
This stored procedure is no longer being updated to coincide with additional enhancements to Data Classification.
You can continue to use this stored procedure as shown in Use sensitive data classification with the classic APIs.
However, plan to update your workflows as shown in Classify sensitive data manually.
Examples¶
Extract the semantic and privacy categories for the my_db.my_schema.hr_data
table and apply the categories as tags for the table:
USE ROLE data_engineer; CALL ASSOCIATE_SEMANTIC_CATEGORY_TAGS('mydb.my_schema.hr_data', EXTRACT_SEMANTIC_CATEGORIES('mydb.my_schema.hr_data'));Copy
Apply the results from EXTRACT_SEMANTIC_CATEGORIES that have been stored in the classification_results
table:
USE ROLE data_engineer; CALL ASSOCIATE_SEMANTIC_CATEGORY_TAGS('mydb.my_schema.hr_data', (SELECT * FROM classification_results));Copy
Modify the results from EXTRACT_SEMANTIC_CATEGORIES in the classification_results
table and apply the
tags:
USE ROLE data_engineer; UPDATE classification_results SET V = OBJECT_INSERT(V,'LNAME',OBJECT_INSERT( OBJECT_INSERT(V:LNAME,'semantic_category','NAME',TRUE), 'privacy_category','IDENTIFIER',TRUE), TRUE ); CALL ASSOCIATE_SEMANTIC_CATEGORY_TAGS('mydb.my_schema.hr_data', (SELECT * FROM classification_results));Copy