SnowPro Specialty: Gen AI Question 83
Single answer2.1 Apply Gen AI and LLM functions in Snowflake.A retail company stores millions of customer support cases in a Snowflake table named SUPPORT_CASES(case_id, case_text, created_at). Analysts want to add a concise summary and sentiment label for each new case directly in Snowflake SQL, without exporting data to an external application. The solution should use Snowflake-managed LLM functionality and be easy to incorporate into ELT pipelines. Which approach best meets these requirements?
- A
Create a SQL transformation that calls SNOWFLAKE.CORTEX.SUMMARIZE(case_text) for the summary and SNOWFLAKE.CORTEX.SENTIMENT(case_text) for the sentiment label, then write the results into a target table.
- B
Train a custom large language model inside a Snowpark Python stored procedure and call it from SQL for every row in SUPPORT_CASES.
- C
Export SUPPORT_CASES to an external REST API, generate summaries and sentiments there, and reload the results into Snowflake because Snowflake SQL cannot apply LLM functions to table data.
- D
Use a standard SQL window function over case_text to derive summaries and sentiment scores, because Cortex functions are only available in Snowsight worksheets and not in pipelines.
Show answer and explanation
Correct answer: A
Explanation
The best answer is to use Snowflake Cortex AISQL functions directly in SQL. For this scenario, SNOWFLAKE.CORTEX.SUMMARIZE can generate concise summaries from case text, and SNOWFLAKE.CORTEX.SENTIMENT can classify sentiment without moving data outside Snowflake. This aligns with Snowflake best practices for minimizing data egress, simplifying architecture, and integrating AI into existing data engineering workflows. In practical implementations, teams often use these functions in INSERT ... SELECT, CREATE TABLE AS SELECT, tasks, or other ELT orchestration patterns. Snowflake documentation on Cortex AISQL describes SQL functions for common GenAI and text AI tasks, including summarization and sentiment, making option 1 the most direct and operationally appropriate solution.
- A. Correct.
Correct. Snowflake Cortex provides SQL-accessible AI functions, including text summarization and sentiment analysis, that can be applied directly to table data in Snowflake. This approach keeps data in-platform, uses Snowflake-managed functionality, and fits naturally into SQL-based ELT pipelines such as tasks, dynamic tables, or scheduled transformations.
- B. Incorrect.
Incorrect. The scenario specifically asks for Snowflake-managed LLM functionality that is easy to use in SQL pipelines. Training a custom LLM inside a stored procedure is not the intended or typical approach for this use case, and Snowflake does not position Cortex SQL functions as requiring customers to train their own models for summarization or sentiment analysis.
- C. Incorrect.
Incorrect. This option reflects a common misconception. Snowflake does support AI/LLM functions callable from SQL against table data, so exporting to an external API is unnecessary for this requirement and introduces avoidable complexity, latency, governance risk, and data movement.
- D. Incorrect.
Incorrect. Standard SQL window functions cannot perform generative summarization or LLM-based sentiment inference. Also, the claim that Cortex functions are limited to Snowsight worksheets is false; they are designed to be used in SQL workflows and can be incorporated into pipelines.