Valid SPS-C01 Dumps shared by EduDump.com for Helping Passing SPS-C01 Exam! EduDump.com now offer the newest SPS-C01 exam dumps, the EduDump.com SPS-C01 exam questions have been updated and answers have been corrected get the newest EduDump.com SPS-C01 dumps with Test Engine here:
Consider a Snowflake table 'sales_data' with a VARIANT column 'order_details' containing an array of JSON objects, where each object represents an item in an order. Each item object has fields like 'quantity', and 'price'. You need to calculate the total price for each order by summing the product of 'quantity' and 'price' for all items in the 'order_details' array. Which of the following Snowpark Python snippets correctly accomplishes this?
Correct Answer: D
Option D first flattens the array of order items using 'flatten' , creating a new row for each item. It then calculates the product of 'quantity' and 'price' for each item and sums these products to get the total price. Option A and C will not work, because they doesn't flatten the array first. Option E should use flatten instead of explode.