Question 116

Consider the following Snowpark code snippet that aims to calculate the rank of each employee based on their salary within their respective department. What are potential issues with this code, and how can you improve it? (Select all that apply.)
  • Question 117

    You are developing a Snowpark Python application that performs advanced machine learning model training on a large dataset stored in Snowflake. You observe that the application is memory-intensive, causing frequent spilling to disk and slowing down the training process.
    Which of the following strategies, when implemented in conjunction, is MOST likely to improve the performance of your Snowpark application in this memory-constrained scenario?
  • Question 118

    You have a Snowpark DataFrame 'df' containing customer data with columns 'customer id', 'name', 'age', and 'city'. You want to filter the DataFrame to include only customers from 'New York' who are older than 30, then extract the 'customer id' and 'name' into a Rows object, and finally print the 'name' of the first row in the Rows object. Which of the following code snippets correctly achieves this using Snowpark Python?
  • Question 119

    A Snowpark application needs to process large volumes of sensor data stored in a Snowflake table named , which includes columns , 'timestamp' , and The application must calculate a rolling average of for each over a 5-minute window. The data is not perfectly ordered by 'timestamp' within each 'sensor_id'. What is the MOST efficient and accurate way to implement this rolling average calculation using Snowpark?
  • Question 120

    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.