Inspect Data Meaning
Type: Function
Retrieve column-level governance information for a table. Returns data type classifications, sensitivity levels, PII flags, masking configurations, and applied policies for each column. Optionally filter to specific columns.
Use Cases
- An AI agent checks which columns contain PII before constructing a SELECT statement
- A security review audits masking rules applied to sensitive columns
- An agent determines which columns it can safely include in an output dataset
- A data engineer verifies that classification and masking are correctly configured after a policy deployment
Input Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
table_name | string | Yes | Fully qualified table name (DB.SCHEMA.TABLE). |
columns | array | No | Array of column name strings to inspect. If omitted, all governed columns in the table are returned. |
Output Schema
Returns an array of column objects:
| Field | Type | Description |
|---|---|---|
column_name | string | Name of the column |
data_type | object | Semantic data type classification |
data_type.id | string | Machine-readable type identifier (e.g., email_address, phone_number, full_name) |
data_type.label | string | Human-readable label (e.g., "Email Address", "Phone Number") |
sensitivity | string | Column sensitivity: public, internal, confidential, or restricted |
is_pii | boolean | Whether this column is classified as personally identifiable information |
masking | object | Masking configuration |
masking.enabled | boolean | Whether masking is active on this column |
masking.type | string | Masking type: hash, redact, partial, null, or none |
masking.config | object | Additional masking parameters (e.g., {"visible_chars": 4} for partial masking) |
masking.exempt_roles | array | Roles that bypass masking (e.g., ["DATA_ADMIN"]) |
policy | object | Policy that governs this column |
policy.id | string | Policy identifier |
policy.name | string | Human-readable policy name |
Example Response
{
"status": "success",
"data": [
{
"column_name": "EMAIL",
"data_type": {
"id": "email_address",
"label": "Email Address"
},
"sensitivity": "confidential",
"is_pii": true,
"masking": {
"enabled": true,
"type": "partial",
"config": {
"visible_chars": 4,
"mask_char": "*",
"preserve_domain": true
},
"exempt_roles": ["DATA_ADMIN", "COMPLIANCE_OFFICER"]
},
"policy": {
"id": "pol_customer_pii_001",
"name": "Customer PII Protection"
}
},
{
"column_name": "ACCOUNT_STATUS",
"data_type": {
"id": "categorical",
"label": "Categorical"
},
"sensitivity": "internal",
"is_pii": false,
"masking": {
"enabled": false,
"type": "none",
"config": {},
"exempt_roles": []
},
"policy": {
"id": "pol_customer_pii_001",
"name": "Customer PII Protection"
}
}
],
"errors": []
}
SQL Examples
Inspect all columns in a table
SELECT METATATE_APP.CORE.INSPECT_COLUMNS(
OBJECT_CONSTRUCT('table_name', 'ANALYTICS_DB.CORE.CUSTOMERS')
);
Inspect specific columns
SELECT METATATE_APP.CORE.INSPECT_COLUMNS(
OBJECT_CONSTRUCT(
'table_name', 'ANALYTICS_DB.CORE.CUSTOMERS',
'columns', ARRAY_CONSTRUCT('EMAIL', 'PHONE', 'SSN')
)
);
Extract PII columns only
SELECT col.value:column_name::STRING AS column_name,
col.value:sensitivity::STRING AS sensitivity,
col.value:masking:type::STRING AS masking_type
FROM TABLE(FLATTEN(
METATATE_APP.CORE.INSPECT_COLUMNS(
OBJECT_CONSTRUCT('table_name', 'ANALYTICS_DB.CORE.CUSTOMERS')
):data
)) col
WHERE col.value:is_pii = TRUE;
JSON Request / Response (API)
Request:
{
"method": "tools/call",
"params": {
"name": "inspect-data-meaning",
"arguments": {
"table_name": "ANALYTICS_DB.CORE.CUSTOMERS",
"columns": ["EMAIL", "PHONE"]
}
}
}
Response:
{
"content": [
{
"type": "text",
"text": "{\"status\":\"success\",\"data\":[{\"column_name\":\"EMAIL\",\"data_type\":{\"id\":\"email_address\",\"label\":\"Email Address\"},\"sensitivity\":\"confidential\",\"is_pii\":true,\"masking\":{\"enabled\":true,\"type\":\"partial\",\"config\":{\"visible_chars\":4,\"mask_char\":\"*\",\"preserve_domain\":true},\"exempt_roles\":[\"DATA_ADMIN\"]},\"policy\":{\"id\":\"pol_customer_pii_001\",\"name\":\"Customer PII Protection\"}},{\"column_name\":\"PHONE\",\"data_type\":{\"id\":\"phone_number\",\"label\":\"Phone Number\"},\"sensitivity\":\"confidential\",\"is_pii\":true,\"masking\":{\"enabled\":true,\"type\":\"redact\",\"config\":{},\"exempt_roles\":[\"DATA_ADMIN\"]},\"policy\":{\"id\":\"pol_customer_pii_001\",\"name\":\"Customer PII Protection\"}}],\"errors\":[]}"
}
]
}
Try it in the app
Open Metatate and navigate to the Test Tools tab to run inspect-data-meaning interactively. Enter a table name and optionally select specific columns to inspect.