ExamGecko
Question list
Search
Search

Question 486 - SnowPro Core discussion

Report
Export

Which function is used to convert rows in a relational table to a single VARIANT column?

A.

ARRAY_AGG

Answers
A.

ARRAY_AGG

B.

OBJECT_AGG

Answers
B.

OBJECT_AGG

C.

ARRAY_CONSTRUCT

Answers
C.

ARRAY_CONSTRUCT

D.

OBJECT_CONSTRUCT

Answers
D.

OBJECT_CONSTRUCT

Suggested answer: D

Explanation:

The OBJECT_CONSTRUCT function in Snowflake is used to convert rows in a relational table into a single VARIANT column that represents each row as a JSON object. This function dynamically creates a JSON object from a list of key-value pairs, where each key is a column name and each value is the corresponding column value for a row. This is particularly useful for aggregating and transforming structured data into semi-structured JSON format for further processing or analysis.

Snowflake Documentation: Semi-structured Data Functions

asked 29/10/2024
Anu V
34 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first