Pick the best non-null value from a group (quality-aware COALESCE)
Per-group — reads the whole group in one call.
COALESCE_SMART({{ values }})COALESCE_SMART({{ values }}, '{{ preference }}')| name | type | description |
|---|---|---|
| values | VARCHAR | Values to coalesce |
| preference(optional) | VARCHAR | Preference hint: 'prefer mobile', 'prefer complete', etc. |
Picks best non-null value, skipping fake emails
WITH
test_data AS (
SELECT
*
FROM
(
VALUES
(NULL),
('N/A'),
('test@test.com'),
('jane@company.com')
) AS t (email)
)
SELECT
COALESCE_SMART (email)
FROM
test_dataRemove 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)
Fill in missing parts of a partial value using context
Pick the best non-null value from a group (quality-aware COALESCE)
Per-group — reads the whole group in one call.
COALESCE_SMART({{ values }})COALESCE_SMART({{ values }}, '{{ preference }}')| name | type | description |
|---|---|---|
| values | VARCHAR | Values to coalesce |
| preference(optional) | VARCHAR | Preference hint: 'prefer mobile', 'prefer complete', etc. |
Picks best non-null value, skipping fake emails
WITH
test_data AS (
SELECT
*
FROM
(
VALUES
(NULL),
('N/A'),
('test@test.com'),
('jane@company.com')
) AS t (email)
)
SELECT
COALESCE_SMART (email)
FROM
test_dataRemove 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)
Fill in missing parts of a partial value using context