Question 56

You are tasked with building a Snowpark Python application to process JSON files stored in a Snowflake stage. The JSON files contain customer feedback data, including sentiment scores. You need to create a stored procedure that reads the JSON files, calculates the average sentiment score, and stores the result in a Snowflake table. You also need to handle potential errors, such as invalid JSON format in some files, and continue processing other files. Which of the following approaches is MOST efficient and robust to handle this scenario?
  • Question 57

    You are building a Snowpark application that involves a UDF. Consider that you are creating UDF as follows:
  • Question 58

    You've written a Snowpark stored procedure in Python that utilizes a custom Python library named 'my utils.py' containing utility functions for data transformation. This library is not available in Anaconda'. You want to deploy the stored procedure and ensure that the custom library is accessible during execution. Which is the most appropriate way to operationalize your Snowpark stored procedure with the custom library?
  • Question 59

    You are building a Snowpark application that processes a large number of PDF files stored in a Snowflake stage. You need to extract text from each PDF file using a Python UDF and store the extracted text in a Snowflake table. You are considering different approaches for loading the PDF files into the UDE Which of the following approaches would provide the BEST performance and scalability, while minimizing network traffic and memory usage?
  • Question 60

    You are using Snowpark to process a DataFrame 'employee df containing employee data, including 'employee_id', 'name' , 'department' , and 'salary'. You need to implement a complex data cleaning and transformation pipeline that involves the following steps: 1. Remove duplicate rows based on 'employee id'. 2. Fill missing 'salary' values with the average salary for the employee's department. 3. Standardize department names by converting them to uppercase. 4. Create a new column 'salary_range' based on the salary. if Salary less than 50k 'Low', greater than 50k and less than 100k 'Medium', greater than 100k 'High'. Which of the following code snippets MOST effectively combines these transformations into a single, readable, and efficient Snowpark pipeline? Assume you have a session object available named 'session' and import necessary modules from 'snowflake.snowpark.functions as F'