Snowflake Certified SnowPro Specialty - Snowpark - SPS-C01 模擬練習

You are tasked with creating a Snowpark stored procedure to perform complex data transformations using a Pandas DataFrame. You want to optimize the performance of the stored procedure by leveraging Snowpark's distributed execution capabilities. Consider the following code snippet:

Which of the following changes to the above code will significantly improve the performance by utilizing Snowpark's distributed execution?

正解: E
解説: (PassTest メンバーにのみ表示されます)
Consider the following Snowpark code snippet designed to create a temporary table:

A developer encounters an error when calling this function. The error message indicates that the table already exists. How should the developer modify the code to handle this scenario gracefully, preventing the error and ensuring the temporary table is either created or overwritten?

正解: C,D
解説: (PassTest メンバーにのみ表示されます)
You have a complex data pipeline implemented using Snowpark Tasks in a Directed Acyclic Graph (DAG). One of the tasks, , depends on the successful completion of two parent tasks, and 'task B'. You need to implement error handling such that if 'task_R fails, 'task_C' should not be executed, but should still complete its execution regardless of status. If 'task B' fails, 'task_C' should not be executed. How do you configure the task dependencies and error handling in Snowflake to achieve this behavior?

正解: C
解説: (PassTest メンバーにのみ表示されます)
You are tasked with creating a Snowpark session that utilizes a specific Snowflake warehouse for all operations. Which of the following code snippets BEST demonstrates how to correctly specify the 'warehouse' parameter when creating a session using snowpark.Session.builder.configs'?

正解: D
解説: (PassTest メンバーにのみ表示されます)
You are developing a Snowpark application to process images stored in an internal stage. You have defined a Python UDF to detect objects in each image using a pre-trained model. The UDF takes the image file path as input and returns a JSON string containing the detected objects and their bounding boxes. However, you encounter "SerializationError' when running the UDF. Which of the following steps are MOST likely to resolve this issue effectively, assuming the model itself is correctly loaded and functions within the UDF environment?

正解: C,E
解説: (PassTest メンバーにのみ表示されます)
You have a Snowpark DataFrame 'customer data df containing customer information, including 'customer id', 'email', and phone number'. You need to anonymize the 'email' and 'phone number" columns for customers residing in specific countries (e.g., 'USA', 'Canada') before persisting the changes back to the 'customers' table. Anonymization should replace sensitive data with 'XXXXX'. You want to leverage UDF for obfuscation. What is correct and optimal approach considering performance and security?

正解: C,D
解説: (PassTest メンバーにのみ表示されます)
You have a Snowflake stage containing image files. You need to write a Snowpark Python application that extracts metadata (e.g., image resolution, format) from these images and stores the metadata in a Snowflake table. You want to leverage a Python library, such as Pillow (PIL), for image processing. Which of the following steps are necessary to correctly and efficiently implement this?

正解: E
解説: (PassTest メンバーにのみ表示されます)
Consider the following Snowpark Python code snippet that defines and registers a User-Defined Table Function (UDTF):

Which of the following statements is MOST accurate regarding the behavior and limitations of this UDTF when used in a Snowpark DataFrame transformation?

正解: B
解説: (PassTest メンバーにのみ表示されます)