Add LLM-computed columns to query results
Table-in, table-out — composes downstream of SELECTs.
THEN ENRICH {{ prompt }}THEN ENRICH({{ prompt }})| name | type | description |
|---|---|---|
| prompt | VARCHAR | — |
| _table | TABLE | — |
Preserves original rows while adding the requested enrichment column
SELECT
*
FROM
(
VALUES
('Great product'),
('Terrible experience')
) AS t (review) THEN ENRICH (
'add a sentiment_label column with values positive or negative'
) THEN PYTHON (
'result = pd.DataFrame({"ok":["sentiment_label" in df.columns and len(df) == 2]})'
)Apply theme styling to a chart specification
Analyze query results with LLM based on a prompt
Remove duplicate rows
Filter query results using LLM-based semantic matching
Group by column and aggregate another
Investigative analysis - explores related data to answer questions
Add LLM-computed columns to query results
Table-in, table-out — composes downstream of SELECTs.
THEN ENRICH {{ prompt }}THEN ENRICH({{ prompt }})| name | type | description |
|---|---|---|
| prompt | VARCHAR | — |
| _table | TABLE | — |
Preserves original rows while adding the requested enrichment column
SELECT
*
FROM
(
VALUES
('Great product'),
('Terrible experience')
) AS t (review) THEN ENRICH (
'add a sentiment_label column with values positive or negative'
) THEN PYTHON (
'result = pd.DataFrame({"ok":["sentiment_label" in df.columns and len(df) == 2]})'
)Apply theme styling to a chart specification
Analyze query results with LLM based on a prompt
Remove duplicate rows
Filter query results using LLM-based semantic matching
Group by column and aggregate another
Investigative analysis - explores related data to answer questions