A reference of SQL functions you can call from your warehouse to enrich, transform, or validate data inline in any query.
BEEM provides a set of SQL functions you can call from your warehouse to enrich, transform, or validate data inline in any query. Just call them like any other SQL function.
All functions below are external functions — they run against BEEM-managed services, so no setup is required in your workspace.
🚧
Rate limits apply
Each function wraps an underlying API (Google, Genderize, Revenu Québec, Bedrock, BEEM internal APIs, etc.) with its own rate limits and quotas. Queries that call a function on many rows can exceed those limits quickly. If you're running a function over a large table, batch your work — e.g. WHERE id BETWEEN X AND Y — or schedule it incrementally rather than running it against the whole table at once.
AI
Apply AI to a row
SQLf_ai(effort, prompt, value)
Apply a natural-language prompt to any value in your query and get an AI-generated result back.
Parameters
Name
Type
Description
effort
VARCHAR
'low', 'med', or 'high' — higher effort is more capable but slower and more expensive.
prompt
VARCHAR
The instruction to apply to each row (e.g. 'Summarize this review in 5 words').
value
VARCHAR
The row value to run the prompt against.
Returns
Type
Description
VARCHAR(MAX)
The AI-generated text.
Example
WITH reviews AS (
SELECT 1 AS review_id, 'Arrived on time and exactly as described, very happy.' AS review_text
UNION ALL SELECT 2, 'Fabric feels cheap and the color is not what was shown online.'
UNION ALL SELECT 3, 'Customer service was excellent, they resolved my issue in minutes.'
)
SELECT
review_id,
f_ai('low', 'Summarize this review in 5 words:', review_text) AS summary
FROM reviews;
Tips
Start with 'low' — it's fast and cheap, and works well for most classification, summarization, and extraction tasks.
Use 'high' only when you need the best possible reasoning (nuanced rewrites, multi-step logic).
Prompts are applied per row — if you have 10,000 rows, the function runs 10,000 times. Test on a small sample first (LIMIT 10) before running on a large table.