SnowPro Advanced: Data Engineer — Question 81
The following FLATTEN command is run:
select *
from table(flatten(input => parse_json('{"first_name":"joe",
"last_name": "smith"
"location": {"state":"co", }}'),
recursive => true )) f;
How many rows will be returned?
Answer options
- A. 1 row
- B. 2 rows
- C. 3 rows
- D. 4 rows
Correct answer: D
Explanation
The FLATTEN command in this context takes a JSON input and expands it into a tabular format. Given the JSON structure, there are multiple key-value pairs and an embedded object which results in four distinct rows being returned.