nerdexam
Snowflake

COF-C02 · Question #226

What is the purpose of using the OBJECT_CONSTRUCT function with me COPY INTO command?

The correct answer is B. Convert the rows in a relational table lo a single VARIANT column and then unload the rows into a. OBJECT_CONSTRUCT is a Snowflake semi-structured function that takes key-value pairs and builds a VARIANT (JSON object). When combined with COPY INTO <location>, it converts each row of a relational table into a single VARIANT column (a JSON object), which is then unloaded into…

Data Loading and Unloading

Question

What is the purpose of using the OBJECT_CONSTRUCT function with me COPY INTO command?

Options

  • AReorder the rows in a relational table and then unload the rows into a file
  • BConvert the rows in a relational table lo a single VARIANT column and then unload the rows into a
  • CReorder the data columns according to a target table definition and then unload the rows into the
  • DConvert the rows in a source file to a single variant column and then load the rows from the file to

How the community answered

(55 responses)
  • A
    4% (2)
  • B
    95% (52)
  • D
    2% (1)

Explanation

OBJECT_CONSTRUCT is a Snowflake semi-structured function that takes key-value pairs and builds a VARIANT (JSON object). When combined with COPY INTO <location>, it converts each row of a relational table into a single VARIANT column (a JSON object), which is then unloaded into a file (typically JSON or Parquet). This is the standard technique for exporting relational data as semi-structured output. It does not reorder rows (A), reorder columns per a target definition (C), or load data from a file into a table (D).

Topics

#OBJECT_CONSTRUCT function#COPY INTO (unload)#VARIANT data type#Data format conversion

Community Discussion

No community discussion yet for this question.

Full COF-C02 Practice