SnowPro Specialty: Gen AI exam dumps

SnowPro Specialty: Gen AI practice question 186 of 287

SnowPro® Specialty: Gen AI. Expert level, Snowflake. Free question with the correct answer and a full explanation.

SnowPro Specialty: Gen AI Question 186

Single answerExtracting data from text using COMPLETE

A retail company stores customer support emails in a Snowflake table named SUPPORT_EMAILS with columns EMAIL_ID and EMAIL_BODY. The analytics team wants to use Snowflake Cortex COMPLETE to extract three fields from each email: order_number, issue_type, and sentiment. They need the output to be easy to query downstream in SQL and as consistent as possible across millions of rows. Which approach is the BEST choice?

  1. A

    Call COMPLETE with a prompt that asks for the three fields in natural language, then store the free-form text response in a VARCHAR column and parse it later with string functions.

  2. B

    Call COMPLETE with a prompt that instructs the model to return only a valid JSON object containing order_number, issue_type, and sentiment, then use SQL to parse the JSON output into structured columns.

  3. C

    Use COMPLETE without any prompt engineering because the model automatically returns relational columns when it detects extraction tasks.

  4. D

    Use COMPLETE to summarize each email first, then apply sentiment analysis on the summary and infer the order number from the summarized text.

Show answer and explanation

Correct answer: B

Explanation

When using Snowflake Cortex COMPLETE for extracting data from text, the most reliable pattern is to explicitly request a structured response, typically JSON with a fixed set of keys, and then parse that output in SQL for downstream analytics. COMPLETE is a text generation function, so it does not inherently return separate SQL columns. In production pipelines, free-form outputs are harder to validate and parse consistently at scale. Best practice is to constrain output format as much as possible, keep the prompt explicit, and then use Snowflake SQL JSON-processing capabilities to convert the generated JSON into structured fields. This reflects practical guidance for applying LLMs to information extraction workloads in Snowflake.

  • A. Incorrect.

    This is not the best choice for large-scale extraction pipelines. Although COMPLETE can generate free-form text, storing unstructured responses makes downstream parsing brittle and error-prone. String-based parsing often breaks when wording varies across responses. A common best practice for extraction tasks is to constrain the model output to a structured format such as JSON so SQL can reliably process it.

  • B. Correct.

    This is the best answer. For extraction use cases with COMPLETE, prompting the model to return only valid JSON with a fixed schema improves consistency and makes downstream processing much easier. Snowflake teams commonly use structured outputs for extraction because JSON can be parsed in SQL and mapped into columns. This approach aligns with practical best practices for turning LLM output into queryable data.

  • C. Incorrect.

    This is incorrect because COMPLETE does not automatically emit relational columns based on task detection. It returns model-generated text. If structured extraction is required, the developer must explicitly design the prompt and downstream parsing approach. Assuming automatic columnar output is a misconception about how text-generation functions work.

  • D. Incorrect.

    This is incorrect because summarization introduces unnecessary information loss before extraction. If the team needs specific entities such as order_number along with issue_type and sentiment, extracting directly from the original email is more reliable. Summaries may omit key details or alter phrasing, which can reduce extraction accuracy.

Timed practice exam

Take a SnowPro Specialty: Gen AI practice test under exam conditions

55 questions in 85 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam