surfaceextractionsmart_split
Extractionscalar · returns varchar

SMART_SPLIT

Split a value into components without hardcoding a delimiter

Per-row — runs once for each row.

extractionllmtext

Syntax

SMART_SPLIT({{ value }})
SMART_SPLIT({{ value }}, '{{ instruction }}')

Arguments

nametypedescription
valueVARCHAR
instructionVARCHARSplit instruction: delimiter, 'into array', 'into first and last', etc.

About

Split a value into meaningful components without hand-specifying a delimiter. Handles commas, slashes, dashes, whitespace, natural- language conjunctions ("John and Jane"), and typical CSV oddities. Useful for columns where multiple facts got packed into one cell: full-name columns mixing first/last, address columns with street plus city plus state crammed together, tag columns with inconsistent separators. Pass an optional `instruction` to steer what to split by — for example, `"by sentence"` or `"on the first comma only"`.

Examples

Comma-separated values split correctly

SELECT
  smart_split ('apple,banana,cherry', 'comma')

Name split into first/last

SELECT
  smart_split ('John Smith', 'into first and last')

Nearby rabbit holes

same domain
Climb back to The Looking Glass