1. A data steward wants to apply an object tag to a table and then verify the tag is correctly propagated. After running: CREATE TAG governance.tags.data_sensitivity ALLOWED_VALUES 'HIGH', 'MEDIUM', 'LOW'; ALTER TABLE finance.public.accounts SET TAG governance.tags.data_sensitivity = 'HIGH'; Which query will correctly confirm the tag assignment on the table?
- A. SELECT * FROM SNOWFLAKE.ACCOUNT_USAGE.TAG_REFERENCES WHERE OBJECT_NAME = 'ACCOUNTS' AND TAG_NAME = 'DATA_SENSITIVITY';
- B. SELECT SYSTEM$GET_TAG('governance.tags.data_sensitivity', 'finance.public.accounts', 'table');✓ Correct
- C. SELECT TAG_VALUE FROM INFORMATION_SCHEMA.TAGS WHERE TABLE_NAME = 'ACCOUNTS';
- D. SELECT * FROM SNOWFLAKE.ACCOUNT_USAGE.OBJECT_TAGS WHERE OBJECT_NAME = 'ACCOUNTS';
Explanation
SYSTEM$GET_TAG is the correct function to retrieve the value of a specific tag on a specific object in real time. It accepts the fully qualified tag name, the fully qualified object name, and the object type ('table', 'column', etc.), returning the tag value or NULL if not set. Option A references ACCOUNT_USAGE.TAG_REFERENCES, which is a valid view but has up to a 2-hour data latency (as with all ACCOUNT_USAGE views) and is better suited for bulk auditing rather than immediate verification. Option C is incorrect: INFORMATION_SCHEMA.TAGS is the view for listing tag definitions (metadata about the tags themselves), not for querying which tags are applied to which objects. Option D is incorrect: SNOWFLAKE.ACCOUNT_USAGE.OBJECT_TAGS is not a standard Snowflake view name; the correct view for tag assignments is TAG_REFERENCES.