Remove or mask personally identifiable information from text
Per-row — runs once for each row.
ANONYMIZE({{ value }})ANONYMIZE({{ value }}, '{{ mode }}')ANONYMIZE({{ value }}, '{{ mode }}', '{{ pii_types }}')| name | type | description |
|---|---|---|
| value | VARCHAR | — |
| mode(optional) | VARCHAR | Mode: redact ([REDACTED]), mask (j***@...), fake (realistic replacement), hash |
| pii_types(optional) | VARCHAR | PII types: name,email,phone,ssn,address,dob,credit_card,ip (comma-separated or 'all') |
Name should be redacted
SELECT
anonymize ('John Smith, john@email.com')Phone should be redacted
SELECT
anonymize ('Call me at 555-123-4567')Type-cast messy real-world values that trip up standard CAST
Return the canonical/official form of a value (auto-detects entity type)
Extracts 4-digit year from messy text, returns -1 if undetermined
LLM-backed year extraction (escape hatch for CLEAN_YEAR)
Pick the best non-null value from a group (quality-aware COALESCE)
Fill in missing parts of a partial value using context
Remove or mask personally identifiable information from text
Per-row — runs once for each row.
ANONYMIZE({{ value }})ANONYMIZE({{ value }}, '{{ mode }}')ANONYMIZE({{ value }}, '{{ mode }}', '{{ pii_types }}')| name | type | description |
|---|---|---|
| value | VARCHAR | — |
| mode(optional) | VARCHAR | Mode: redact ([REDACTED]), mask (j***@...), fake (realistic replacement), hash |
| pii_types(optional) | VARCHAR | PII types: name,email,phone,ssn,address,dob,credit_card,ip (comma-separated or 'all') |
Name should be redacted
SELECT
anonymize ('John Smith, john@email.com')Phone should be redacted
SELECT
anonymize ('Call me at 555-123-4567')Type-cast messy real-world values that trip up standard CAST
Return the canonical/official form of a value (auto-detects entity type)
Extracts 4-digit year from messy text, returns -1 if undetermined
LLM-backed year extraction (escape hatch for CLEAN_YEAR)
Pick the best non-null value from a group (quality-aware COALESCE)
Fill in missing parts of a partial value using context