surfaceextractionparse
Extractionscalar · returns varchar

PARSE

Extract information from text using natural-language instructions

Per-row — runs once for each row.

extractionllmtext

Syntax

PARSE({{ text }}, {{ instruction }})
{{ text }} PARSE {{ instruction }}

Arguments

nametypedescription
textVARCHARThe text to parse
instructionVARCHARWhat to extract (natural language)

About

General-purpose text parser. Extract any information from text using natural language instructions. Unlike specialized parsers (PARSE_NAME, PARSE_ADDRESS), this function handles arbitrary extraction tasks. Uses structural caching: analyzes the input shape and generates a reusable SQL expression. Different values with the same shape reuse the cached SQL.

Examples

Date extracted from text

SELECT
  parse (
    'Meeting scheduled for March 15, 2024 at 2pm',
    'the date'
  )

Email extracted from text

SELECT
  parse (
    'Contact John Smith at john@acme.com for details',
    'email address'
  )

Amount extracted from text

SELECT
  parse ('The project budget is $50,000', 'budget amount')

Nearby rabbit holes

same domain
Climb back to The Looking Glass