surfaceextractionsmart_unpack
Extractionscalar · returns varchar

SMART_UNPACK

Extract multiple distinct values from a compound/messy field

Per-row — runs once for each row.

extractionllmtext

Syntax

SMART_UNPACK({{ value }})
SMART_UNPACK({{ value }}, '{{ extract }}')

Arguments

nametypedescription
valueVARCHAR
extract(optional)VARCHARWhat to extract: 'email and phone', 'name and title', 'auto'

About

Pull multiple distinct values out of a single compound or messy field. Common when a CSV import squished several fields into one column (`"John Smith, 555-1234, CA, 95008"`) or when free-text entries contain several pieces of structured information. Optionally pass an `extract` hint naming what you want pulled out (`"phone number"`, `"state code"`); without it the operator returns all detected structured values.

Examples

Email and phone unpacked

SELECT
  smart_unpack ('john@email.com, 555-1234')

Nearby rabbit holes

same domain
Climb back to The Looking Glass