Exam SnowPro Core All QuestionsBrowse all questions from this exam
Question 695

A JSON file that contains lots of dates and arrays needs to be processed in Snowflake. The user wants to ensure optimal performance while querying the data.

How can this be achieved?

    Correct Answer: A

    To ensure optimal performance while querying a JSON file that contains lots of dates and arrays in Snowflake, the best approach is to flatten the data and store it in structured data types in a flattened table. Flattening the data allows for better pruning and less storage consumption, especially when dealing with dates, timestamps, and arrays. This method leverages Snowflake's efficient handling of structured relational columns, which can significantly enhance query performance compared to querying semi-structured VARIANT columns directly.

Discussion
MultiCloudIronManOption: A

correct

0e504b5Option: A

I'm undecided between A vs. B. In a real-world task, I would do B and do some ELT if needed to prep the data for analysis. Based on the docs below, it appears that A is recommended by Snowflake as more performant. https://docs.snowflake.com/en/user-guide/semistructured-considerations Storing Semi-structured Data in a VARIANT Column vs. Flattening the Nested Structure¶ For better pruning and less storage consumption, we recommend flattening your OBJECT and key data into separate relational columns if your semi-structured data includes: Dates and timestamps, especially non-ISO 8601 dates and timestamps, as string values Numbers within strings Arrays

pvskbrodOption: B

I hesitate between A&B And will be happy to provoke a discussion If you know your use cases for the data, perform tests on a typical data set. Load the data set into a VARIANT column in a table. Use the FLATTEN function to extract the OBJECTs and keys you plan to query into a separate table. Run a typical set of queries against both tables to see which structure provides the best performance. https://docs.snowflake.com/en/user-guide/semistructured-considerations

pvskbrod

I have changed my opinion to B For better pruning and less storage consumption, we recommend flattening your OBJECT and key data into separate relational columns if your semi-structured data includes: Dates and timestamps, especially non-ISO 8601 dates and timestamps, as string values Numbers within strings Arrays

Rajivnb

You mean A? From your explanation, creating it in a relational table makes use of the Date/Time ranges for Micro-Partition clustering. helps Pruning.

icegrandpaOption: C

why not C?