Parse and normalize a quantity expression to a structured JSON
Per-row — runs once for each row.
NORMALIZE_QUANTITY({{ value }})NORMALIZE_QUANTITY({{ value }}, '{{ system }}')| name | type | description |
|---|---|---|
| value | VARCHAR | — |
| system(optional) | VARCHAR | — |
Simple quantity parsed with metric unit
SELECT
normalize_quantity ('500 mg')Imperial-to-metric conversion preserves unit type
SELECT
normalize_quantity ('about 5 gallons', 'metric')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)
Parse and normalize a quantity expression to a structured JSON
Per-row — runs once for each row.
NORMALIZE_QUANTITY({{ value }})NORMALIZE_QUANTITY({{ value }}, '{{ system }}')| name | type | description |
|---|---|---|
| value | VARCHAR | — |
| system(optional) | VARCHAR | — |
Simple quantity parsed with metric unit
SELECT
normalize_quantity ('500 mg')Imperial-to-metric conversion preserves unit type
SELECT
normalize_quantity ('about 5 gallons', 'metric')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)