COF-C02 · Question #599
What is the benefit of using the STRIP_OUTER_ARRAY parameter with the COPY INTO <table> command when loading data from a JSON file into a table?
The correct answer is B. It removes the outer array structure and loads separate rows of data. When a JSON file contains a top-level array (e.g., [{...}, {...}, {...}]), Snowflake would by default load the entire file as a single VARIANT row. Setting STRIP_OUTER_ARRAY = TRUE removes the enclosing brackets and treats each element of the array as a separate row, which is…
Question
What is the benefit of using the STRIP_OUTER_ARRAY parameter with the COPY INTO <table> command when loading data from a JSON file into a table?
Options
- AIt flattens multiple arrays into a single array.
- BIt removes the outer array structure and loads separate rows of data
- CIt transforms a pivoted table into an array.
- DIt tokenizes each data string using the defined delimiters.
How the community answered
(48 responses)- A6% (3)
- B88% (42)
- C2% (1)
- D4% (2)
Explanation
When a JSON file contains a top-level array (e.g., [{...}, {...}, {...}]), Snowflake would by default load the entire file as a single VARIANT row. Setting STRIP_OUTER_ARRAY = TRUE removes the enclosing brackets and treats each element of the array as a separate row, which is almost always the desired behavior for JSON arrays. It does not flatten nested arrays (A), reverse a pivot (C), or tokenize strings by delimiters (D).
Topics
Community Discussion
No community discussion yet for this question.