Type-cast messy real-world values that trip up standard CAST
Per-row — runs once for each row.
CAST_SMART({{ value }}, '{{ target_type }}'){{ value }} AS_SMART {{ target_type }}| name | type | description |
|---|---|---|
| value | VARCHAR | — |
| target_type | VARCHAR | Target type: INTEGER, DECIMAL, DATE, TIMESTAMP, BOOLEAN, VARCHAR |
String to integer
SELECT
cast_smart ('25', 'integer')Remove or mask personally identifiable information from text
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
Type-cast messy real-world values that trip up standard CAST
Per-row — runs once for each row.
CAST_SMART({{ value }}, '{{ target_type }}'){{ value }} AS_SMART {{ target_type }}| name | type | description |
|---|---|---|
| value | VARCHAR | — |
| target_type | VARCHAR | Target type: INTEGER, DECIMAL, DATE, TIMESTAMP, BOOLEAN, VARCHAR |
String to integer
SELECT
cast_smart ('25', 'integer')Remove or mask personally identifiable information from text
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