surfaceextractionparse_email_llm
Extractionscalar · returns json

PARSE_EMAIL_LLM

LLM-backed email parsing (escape hatch for PARSE_EMAIL)

Per-row — runs once for each row.

extractionllmllm-escape-hatchemail

Syntax

PARSE_EMAIL_LLM({{ raw_email }})

Arguments

nametypedescription
raw_emailVARCHAR

About

LLM-backed escape hatch for email parsing. Use when the canonical `email.parser` (stdlib) path can't cope — typically non-RFC compliant message formats (chat exports formatted to look like email, proprietary log formats, etc.). For standard RFC 5322 emails, prefer PARSE_EMAIL — stdlib handles those correctly and is far faster.

Examples

LLM escape hatch extracts email fields

SELECT
  parse_email_llm (
    'From: john@example.com
To: jane@example.com
Subject: Hello

This is the body.'
  )

Nearby rabbit holes

same domain
Climb back to The Looking Glass