A product manager wants one summary of 200,000 review rows, more text than fits any context window. Which function fits?
- Exam domain
- Cortex AI functions in SQL
- Difficulty
- Medium
- In this mock
- 5 questions on this domainPractise this domain
Why D is the answer
AI_SUMMARIZE_AGG
Snowflake documents AI_SUMMARIZE_AGG as returning a summary across many rows of a text column without context window limits. AI_AGG does the same for a custom prompt.
Remember: Many rows, one summary: AI_SUMMARIZE_AGG.
In detail
- Aggregate functions span rows.
- No context window limit.
Every option, checked
Knowing why each wrong option fails is how you rule it out on exam day.
A. AI_SIMILARITY between the first and last reviewWrong
Similarity compares two inputs only.
B. AI_SENTIMENT, which returns a summary score for the whole column at onceWrong
AI_SENTIMENT scores sentiment; it does not write a summary.
C. AI_COMPLETE on each row, then read 200,000 answersWrong
Per-row output does not give one summary.
D. AI_SUMMARIZE_AGGRight
Many rows, one summary: AI_SUMMARIZE_AGG.
Use case
An illustrative scenario, not a real incident.
Illustrative: a weekly report summarizes all new reviews in one query.
See it in different ways
flowchart TD
Q{"What do you need?"}
Q -->|"A result per row"| A0["AI_COMPLETE"]
Q -->|"One summary of many rows"| A1["AI_SUMMARIZE_AGG"]
Q -->|"Custom insight over rows"| A2["AI_AGG"]How to read this chart
- At "What do you need?": if "A result per row", go to "AI_COMPLETE"; if "One summary of many rows", go to "AI_SUMMARIZE_AGG"; if "Custom insight over rows", go to "AI_AGG".
flowchart LR S0["Select the text column"] --> S1["Group if needed"] --> S2["AI_SUMMARIZE_AGG"]
How to read this chart
- Read it in order: Select the text column, then Group if needed, then AI_SUMMARIZE_AGG.