Question 31
You're developing a Snowpark Python application to process log files stored in an external stage 's3_logs'. These logs are in plain text, with each line representing a log entry. You need to filter log entries based on a specific keyword and extract timestamps from the matching lines. Which of the following approaches, using and Snowpark DataFrames, will efficiently accomplish this, avoiding unnecessary data transfer to the client?
Question 32
You are developing a Snowpark application to ingest a large dataset into Snowflake. You have a DataFrame with a schema that matches the target table 'TARGET TABLE. Due to network constraints, you need to optimize the insertion process to minimize the number of API calls. Which of the following approaches would provide the MOST efficient way to insert the data?
Question 33
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?
Question 34
You are tasked with optimizing a Snowpark application that performs complex data transformations on a large dataset (1 TB) stored in Snowflake. The application currently uses Snowpark DataFrames and is experiencing slow performance. You suspect the issue might be related to data transfer overhead between the Snowflake engine and the Python environment. Which of the following strategies would be MOST effective in minimizing this overhead and improving performance?
Question 35
You have a Snowpark DataFrame 'products_df with columns 'product_id', 'category', and 'price'. You want to find the top 3 most expensive products within each category Which of the following Snowpark code snippets will accomplish this, using window functions?
