ExamGecko
Question list
Search
Search

Question 633 - COF-C02 discussion

Report
Export

Which function can be used to convert semi-structured data into rows and columns?

A.
TABLE
Answers
A.
TABLE
B.
FLATTEN
Answers
B.
FLATTEN
C.
PARSE_JSON
Answers
C.
PARSE_JSON
D.
JSON EXTRACT PATH TEXT
Answers
D.
JSON EXTRACT PATH TEXT
Suggested answer: B

Explanation:

To convert semi-structured data into rows and columns in Snowflake, the FLATTEN function is utilized.

FLATTEN Function: This function takes semi-structured data (e.g., JSON) and transforms it into a relational table format by breaking down nested structures into individual rows. This process is essential for querying and analyzing semi-structured data using standard SQL operations.

Example Usage:

SELECT

f.value:attribute1 AS attribute1,

f.value:attribute2 AS attribute2

FROM

my_table,

LATERAL FLATTEN(input => my_table.semi_structured_column) f;

References:

Snowflake Documentation on FLATTEN

asked 23/09/2024
Saeed Awwad
46 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first