Snowflake Certified SnowPro Specialty - Snowpark - SPS-C01 Exam Practice Test
When creating UDFs/UDTFs in Snowpark Python, what are the advantages of explicitly specifying data types (either via Python type hints or the registration API) compared to relying on implicit type inference?
Correct Answer: B,C,D
Explanation: Only visible for TrainingDump members. You can sign-up / login (it's free).
You are developing a Snowpark application that performs feature engineering on a dataset of customer transactions. This involves calculating several complex aggregate features such as rolling averages, medians, and custom ratios. You want to optimize the performance of this feature engineering process using a Snowpark-optimized warehouse. Which of the following strategies would be MOST effective in achieving optimal performance?
Correct Answer: B,E
Explanation: Only visible for TrainingDump members. You can sign-up / login (it's free).
Consider a scenario where you have a table 'EMPLOYEES' with columns 'employee id', 'department', and 'salary'. You want to delete employees who belong to either the 'HR' or 'Finance' department and have a salary less than 60000. Which of the following Snowpark DataFrame operations correctly implements this deletion?


Correct Answer: A
Explanation: Only visible for TrainingDump members. You can sign-up / login (it's free).
You have a Snowpark DataFrame with columns 'product_id', 'customer_id', and 'sale_amount'. Some values are negative, indicating returns, and others are null. You need to replace negative values with 0 and fill null values with the average 'sale_amount' for each 'product_id'. Which of the following approaches is the MOST efficient and correct way to achieve this using Snowpark?
Correct Answer: D
Explanation: Only visible for TrainingDump members. You can sign-up / login (it's free).
You are working with Snowpark and need to persist the results of a DataFrame 'df to a Snowflake stage named 'my_stage'. You want to achieve the following: 1. Write the data in JSON format. 2. Use snappy compression. 3. Handle potential write errors gracefully. 4. Overwrite any existing files with the same name. Which of the following approaches can achieve these requirements? (Select all that apply)
Correct Answer: B,D,E
Explanation: Only visible for TrainingDump members. You can sign-up / login (it's free).
You are developing a Snowpark application to process customer sentiment from text reviews. You have a Python function, , that utilizes a pre-trained NLP model loaded from a file on a Snowflake stage named This function returns a sentiment score (float) between -1 and 1. You need to register this function as a UDF so that it can be used within Snowpark DataFrames. Which of the following code snippets correctly registers the UDF, ensuring the NLP model is available to the function during execution?
Correct Answer: D
Explanation: Only visible for TrainingDump members. You can sign-up / login (it's free).
You have a Snowpark Python application that performs complex data transformations and machine learning model training. The data is stored in Snowflake tables. You notice that model training jobs, specifically those involving large feature sets and iterative algorithms, are consistently slow. The warehouse is already scaled to a LARGE size. Which of the following techniques, when applied individually or in combination, would MOST likely improve the performance of model training in Snowpark?
Correct Answer: A,E
Explanation: Only visible for TrainingDump members. You can sign-up / login (it's free).
Consider a Snowpark DataFrame with columns 'DEPARTMENT, 'SALARY , and 'YEAR. You want to find the average salary for each department over all years and then filter the departments to only include those where the average salary is greater than 100000. Which of the following approaches is the MOST efficient and correct way to achieve this using Snowpark Python?
Correct Answer: C
Explanation: Only visible for TrainingDump members. You can sign-up / login (it's free).
Which of the following statements are correct regarding the authentication methods available when creating a Snowpark session?
Correct Answer: A,C,D
Explanation: Only visible for TrainingDump members. You can sign-up / login (it's free).
You are developing a Snowpark application that utilizes a UDF. You need to ensure that the UDF runs with the privileges of the caller (the user executing the query). Which of the following steps are necessary to accomplish this while creating the Snowpark session?
Correct Answer: D
Explanation: Only visible for TrainingDump members. You can sign-up / login (it's free).
You are tasked with building a machine learning pipeline in Snowpark to predict customer churn. You plan to use the scikit-learn library for model training and want to deploy the trained model as a Snowpark UDF for real-time scoring. Consider the following code snippet:
Correct Answer: E
Explanation: Only visible for TrainingDump members. You can sign-up / login (it's free).
You are tasked with creating a series of Snowpark DataFrames for a data transformation pipeline. For debugging purposes, you want to materialize these DataFrames as tables within Snowflake, but only for the duration of your session. You also need to make sure that these tables are automatically cleaned up when your session ends. Which of the following approaches offer(s) the MOST efficient and appropriate way to achieve this?
Correct Answer: D
Explanation: Only visible for TrainingDump members. You can sign-up / login (it's free).
You are developing a Snowpark Python application that connects to Snowflake using key pair authentication. You have the private key stored securely in an environment variable named 'SNOWFLAKE PRIVATE KEY. Which of the following code snippets correctly establishes a Snowpark session using this method, assuming all other necessary connection parameters (account, user, database, schema, warehouse) are also set as environment variables?
Correct Answer: A
Explanation: Only visible for TrainingDump members. You can sign-up / login (it's free).