Check whether a value matches the expected format for a type
Per-row — runs once for each row.
VALID({{ value }}, '{{ type }}'){{ value }} IS VALID '{{ type }}'{{ value }} VALID AS '{{ type }}'| name | type | description |
|---|---|---|
| value | VARCHAR | — |
| type | VARCHAR | Format type: email, phone, url, date, ssn, zip, uuid, ip, credit_card, etc. |
Function: Valid email returns true
SELECT
valid ('john@gmail.com', 'email')Function: Invalid email returns false
SELECT
valid ('not-an-email', 'email')Function: Valid US phone returns true
SELECT
valid ('(555) 123-4567', 'phone')Function: Valid US zip returns true
SELECT
valid ('02101', 'zip')Infix IS VALID: filters valid emails
WITH
t AS (
SELECT
'user@example.org' AS email
)
SELECT
email
FROM
t
WHERE
email IS VALID 'email'Infix IS VALID: returns false for invalid
WITH
t AS (
SELECT
'invalid' AS email
)
SELECT
CASE
WHEN email IS VALID 'email' THEN 'yes'
ELSE 'no'
END
FROM
tInfix VALID AS: validates IP address
WITH
t AS (
SELECT
'10.0.0.1' AS ip
)
SELECT
ip
FROM
t
WHERE
ip VALID AS 'ip'Remove or mask personally identifiable information from text
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)
Check whether a value matches the expected format for a type
Per-row — runs once for each row.
VALID({{ value }}, '{{ type }}'){{ value }} IS VALID '{{ type }}'{{ value }} VALID AS '{{ type }}'| name | type | description |
|---|---|---|
| value | VARCHAR | — |
| type | VARCHAR | Format type: email, phone, url, date, ssn, zip, uuid, ip, credit_card, etc. |
Function: Valid email returns true
SELECT
valid ('john@gmail.com', 'email')Function: Invalid email returns false
SELECT
valid ('not-an-email', 'email')Function: Valid US phone returns true
SELECT
valid ('(555) 123-4567', 'phone')Function: Valid US zip returns true
SELECT
valid ('02101', 'zip')Infix IS VALID: filters valid emails
WITH
t AS (
SELECT
'user@example.org' AS email
)
SELECT
email
FROM
t
WHERE
email IS VALID 'email'Infix IS VALID: returns false for invalid
WITH
t AS (
SELECT
'invalid' AS email
)
SELECT
CASE
WHEN email IS VALID 'email' THEN 'yes'
ELSE 'no'
END
FROM
tInfix VALID AS: validates IP address
WITH
t AS (
SELECT
'10.0.0.1' AS ip
)
SELECT
ip
FROM
t
WHERE
ip VALID AS 'ip'Remove or mask personally identifiable information from text
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)