SPS-C01 無料問題集「Snowflake Certified SnowPro Specialty - Snowpark」
You are working with semi-structured data in Snowflake stored in a VARIANT column named 'payload'. You want to extract specific fields from this VARIANT column within a SQL query used to create a Snowpark DataFrame. Which of the following approaches allows you to access nested fields within the 'payload' column directly in the SQL query and create a corresponding column in your Snowpark DataFrame? Select all that apply.
正解:C、D、E
解答を投票する
解説: (JPNTest メンバーにのみ表示されます)
You have a Python function that calculates a complex statistical measure on a given row of a DataFrame. You want to apply this function to each row of a Snowpark DataFrame in a distributed manner. Which of the following is the MOST efficient way to achieve this?
正解:B
解答を投票する
解説: (JPNTest メンバーにのみ表示されます)
A Snowpark application needs to manage multiple sessions concurrently, each connected to a different Snowflake warehouse for resource isolation. The application receives warehouse names dynamically at runtime. How can the application efficiently create and manage these sessions while ensuring proper resource cleanup?
正解:C
解答を投票する
解説: (JPNTest メンバーにのみ表示されます)
You are developing a Snowpark stored procedure to process PDF files stored in a Snowflake stage. You need to extract text from these PDF files and store the extracted text in a Snowflake table. Due to security requirements, you cannot use any external packages that require internet access. Which of the following approaches can you use to accomplish this task securely and efficiently? (Select all that apply)
正解:A、E
解答を投票する
解説: (JPNTest メンバーにのみ表示されます)
You are tasked with optimizing a Snowpark Python application that performs complex geospatial calculations on a large dataset. The application experiences significant performance bottlenecks due to the computational intensity of the geospatial functions. Which of the following strategies would be MOST effective in improving performance?
正解:D
解答を投票する
解説: (JPNTest メンバーにのみ表示されます)
You have a Snowpark DataFrame containing customer order data with columns , and 'order_amount' . You need to identify customers who placed orders exceeding $1000 on more than 3 separate days. Which Snowpark code snippet correctly achieves this? Assume SparkSession 'spark' and DataFrame are already defined.
正解:C
解答を投票する
解説: (JPNTest メンバーにのみ表示されます)
You are using Snowpark Python to process a DataFrame containing customer data,. One of the columns, 'phone_number' , contains phone numbers in various formats (e.g., '123-456-7890', '(123) 456-7890', '1234567890'). You need to standardize these phone numbers to the format 'XXX-XXX-XXXX' using a User-Defined Function (UDF). You want to create a UDF called 'standardize_phone_number' that takes a string as input and returns the standardized phone number. Which of the following code snippets correctly defines and registers this UDF in Snowpark, and applies it to the 'phone_number' column of the 'customer df DataFrame? Assume a Snowflake session object called 'session' is already available.
正解:D
解答を投票する
解説: (JPNTest メンバーにのみ表示されます)
You have two Snowpark DataFrames: 'employees_df with columns 'employee_id' (INTEGER), 'employee_name' (STRING), 'department_id' (INTEGER), and 'salaries_df' with columns 'employee_id' (INTEGER), "salary' (FLOAT), 'effective_date' (DATE). You need to create a new DataFrame that contains the employee's name, department, and the highest salary they have ever received. Assuming there can be multiple salary entries for the same employee with different 'effective date' values, which of the following Snowpark code snippets would correctly and efficiently solve this problem?
正解:B
解答を投票する
解説: (JPNTest メンバーにのみ表示されます)
You have developed a Snowpark Python stored procedure that calculates the average sales per region from a large sales data table. The procedure is currently defined inline within your Snowflake notebook. You want to operationalize this by creating the stored procedure from a local Python file named The file contains the following code: "'python from snowflake.snowpark.session import Session def calculate_avg_sales(session: Session, sales_table_name: str, region_column: str, sales_column: str) -> float: sales df = session.table(sales table name) avg_sales df = sales_df.group_by(region_column).agg({sales_column: 'avg'}) avg_sales = avg_sales_df.collect() return avg_sales[0][1] Which of the following code snippets correctly creates the stored procedure 'AVG SALES PROC in Snowflake, referencing the Python file, and handles potential dependency issues? Assume you have already established a Snowpark session named 'session' and that the stage 'my_stage' already exists.
正解:B
解答を投票する
解説: (JPNTest メンバーにのみ表示されます)
You have a Snowpark DataFrame named containing daily sales transactions. The DataFrame includes columns like 'transaction_id' , 'product id', 'sale_date', and 'sale_amount'. You need to perform the following transformations and persist the results: (1) Calculate the total sales amount for each product on a daily basis. (2) Store the aggregated results into a new table named , partitioned by 'sale_date'. (3) Ensure that if the table already exists, the new data is appended to the existing table. Which of the following code blocks achieve these requirements in the most efficient and correct manner?
正解:C
解答を投票する
解説: (JPNTest メンバーにのみ表示されます)
Consider the following Snowpark code snippet designed to process data from an event table and calculate a rolling average:

After deploying this code, you observe that the rolling average calculation is significantly slower than expected, even though the virtual warehouse is adequately sized. What is the MOST effective way to optimize the performance of this rolling average calculation in Snowpark, considering the size of window_size ?

After deploying this code, you observe that the rolling average calculation is significantly slower than expected, even though the virtual warehouse is adequately sized. What is the MOST effective way to optimize the performance of this rolling average calculation in Snowpark, considering the size of window_size ?
正解:B
解答を投票する
解説: (JPNTest メンバーにのみ表示されます)
You have two Snowpark DataFrames, 'dfl' and 'df2', representing customer data'. 'dfl' contains customer IDs and names, while 'df2' contains customer IDs and email addresses. You need to create a new DataFrame that contains all customer IDs, names, and email addresses, including customers present in only one of the DataFrames. Which Snowpark set operation and join type would be most appropriate for achieving this?
正解:A
解答を投票する
解説: (JPNTest メンバーにのみ表示されます)
You have a Snowpark DataFrame named 'orders df with columns 'order id', 'customer id', 'order date', and 'total amount'. You need to create a new DataFrame that contains only the 'customer_id" and the total number of orders placed by each customer. However, you want to perform this aggregation in parallel using a user-defined function (UDF) to improve performance. Which approach is MOST efficient and CORRECT?
正解:E
解答を投票する
解説: (JPNTest メンバーにのみ表示されます)
You have a Snowpark DataFrame 'customer df with a 'customer name' column. You need to create a new column 'initials' that contains the initials of each customer's name. For example, if 'customer name' is 'John Doe', 'initials' should be 'JD'. You must handle names with multiple words correctly. Which Snowpark SQL expression using the "col()' function is the most efficient and correct way to define the 'initials' column?
正解:B
解答を投票する
解説: (JPNTest メンバーにのみ表示されます)
