Question 91

You have a Snowflake table named 'RAW EVENTS with a large number of events data, containing columns like 'EVENT ID', 'TIMESTAMP, 'USER ID, and 'EVENT_TYPE. The 'EVENT TYPE column contains string values representing different event categories. You want to create a Snowpark DataFrame, but due to the table's size, you only want to sample a small portion of the data for initial exploration and testing. Which of the following code snippets MOST accurately and efficiently creates a sampled Snowpark DataFrame named 'sampled_df containing approximately 1% of the rows from the 'RAW EVENTS table?
  • Question 92

    You have a Snowflake table 'user_profiles' with a VARIANT column 'profile_data'. This column contains JSON objects, and one of the fields within these objects is an array called 'interests'. The 'interests' array contains JSON objects, each with 'name' and 'category' fields. You need to use Snowpark to flatten the 'interests' array and extract the 'name' and 'category' for all user profiles, but only for profiles where the user's 'status' is 'active'. You want to write this in the most efficient way possible. Which of the following code snippets will achieve this?
  • Question 93

    You have a Snowpark application that reads data from a large Snowflake table and performs several transformations. During testing, you observe that the application's performance is inconsistent, with some runs taking significantly longer than others, even with the same input data'. You suspect that data locality might be a contributing factor. What steps can you take within your Snowpark application to investigate and potentially improve data locality and performance consistency?
  • Question 94

    You have a Snowflake view named 'SALES SUMMARY VW' that joins several large tables and performs complex aggregations. You need to create a Snowpark DataFrame from this view Which of the following considerations are MOST important to ensure optimal performance and resource utilization when working with this DataFrame?
  • Question 95

    You are tasked with processing a Snowpark DataFrame named 'orders df that contains order information. The DataFrame includes the following columns: 'order _ id' (INTEGER), 'customer_id' (INTEGER), 'order_date' (DATE), 'order_total' (STRING), and 'discount_code' (STRING). The 'order_total' column contains values with leading dollar signs and commas (e.g., '$1 ,234.56'). The column can contain codes like 'SAVEIO', 'SAVE20', or be NULL. Your goal is to create a new DataFrame 'transformed_df that includes the following transformations: 1 . Convert the 'order_total' column to a numeric value (DOUBLE) after removing the dollar signs and commas. 2. Apply a discount based on the 'discount_code'. If the 'discount_code' is 'SAVEIO', apply a 10% discount; if it's 'SAVE20', apply a 20% discount. If the 'discount_code' is NULL or any other value, apply no discount (0%). 3. Calculate the 'final_total' after applying the discount. Which of the following code snippets correctly and efficiently implements these transformations using Snowpark?