surfaceextractionparse_typed
Extractionscalar · returns varchar

PARSE_TYPED

Extract structured data from text using a predefined type schema

Per-row — runs once for each row.

extractionllmtext

Syntax

PARSE_TYPED({{ text }}, '{{ extract_type }}')
{{ text }} PARSE_TYPED '{{ extract_type }}'

Arguments

nametypedescription
textVARCHAR
extract_typeVARCHARWhat to extract: address, name, phone, email, date, url, currency, or custom

About

Extract structured components from text using a predefined type schema — address, name, phone, email, date, URL, or currency. Returns a JSON object with canonical component fields for that type. Useful when you know up front what kind of thing you're pulling out of a text blob and want a predictable shape back: the `address` schema always returns `{street, city, state, zip, country}`, the `name` schema always returns `{first, middle, last, suffix}`, and so on. For free-form extraction where the type isn't predefined or the output shape should come from a plain-English prompt, reach for PARSE_VALUE instead. For pulling multiple distinct values from a messy field, use SMART_UNPACK.

Examples

Email extracted from text

SELECT
  parse_typed ('Contact John at john@example.com', 'email')

Address parsed correctly

SELECT
  parse_typed ('123 Main St, Boston MA 02101', 'address')

Nearby rabbit holes

same domain
Climb back to The Looking Glass