SnowPro Associate: Platform Question 329
Single answer● COMPLETE functionA data engineering team is prototyping a support assistant inside Snowflake. They store product documentation in a table and want to use Snowflake Cortex to generate a concise answer to a user's question directly in SQL. The team writes a query using the COMPLETE function and wants the result returned as generated text for each prompt. Which approach correctly uses COMPLETE for this scenario?
- A
SELECT SNOWFLAKE.CORTEX.COMPLETE('snowflake-arctic', 'Summarize the warranty policy in 2 sentences.') AS response;
- B
SELECT COMPLETE('Summarize the warranty policy in 2 sentences.', 'snowflake-arctic') AS response;
- C
SELECT SNOWFLAKE.CORTEX.COMPLETE('snowflake-arctic') AS response;
- D
SELECT SNOWFLAKE.CORTEX.COMPLETE('snowflake-arctic', warranty_text, question_text) AS response FROM support_docs;
Show answer and explanation
Correct answer: A
Explanation
The COMPLETE function in Snowflake Cortex is used to generate text from a prompt directly in SQL. For SnowPro Associate-level knowledge, the key applied concept is recognizing the correct SQL invocation pattern: call SNOWFLAKE.CORTEX.COMPLETE with the model name first, followed by the prompt input. A common mistake is reversing the arguments or assuming multiple free-form text arguments can be passed separately. In real scenarios, when using table data, teams typically construct one prompt string from column values and pass that combined prompt to COMPLETE. This aligns with Snowflake Cortex documentation and best practices for SQL-based LLM inference.
- A. Correct.
Correct. COMPLETE is invoked from the SNOWFLAKE.CORTEX schema and accepts a model name plus a prompt (or structured prompt input, depending on usage). This example correctly supplies a supported calling pattern for generating text from a prompt in SQL.
- B. Incorrect.
Incorrect. This option reverses the expected argument order. COMPLETE expects the model identifier first and the prompt second, so placing the prompt first is not the correct syntax.
- C. Incorrect.
Incorrect. COMPLETE requires more than just the model name. A prompt or prompt payload must also be provided so the model has input to generate a response.
- D. Incorrect.
Incorrect. This suggests passing multiple separate prompt arguments after the model name. COMPLETE does not take arbitrary positional prompt fragments this way. In practice, if data from columns is needed, the query should build a single prompt expression, for example by concatenating text into one prompt value.