nerdexam
Snowflake

COF-C02 · Question #601

Which function determines the kind of value stored in a VARIANT column?

The correct answer is D. TYPEOF. TYPEOF(variant_expression) returns a string describing the Snowflake data type of the value stored in a VARIANT column - for example 'TEXT', 'INTEGER', 'BOOLEAN', 'ARRAY', 'OBJECT', or 'NULL_VALUE'. This is useful when VARIANT columns contain heterogeneous data. CHECK_JSON (A)…

Snowflake Cloud Data Platform Features and Architecture

Question

Which function determines the kind of value stored in a VARIANT column?

Options

  • ACHECK_JSON
  • BIS_ARRAY
  • CIS_JSON
  • DTYPEOF

How the community answered

(22 responses)
  • B
    5% (1)
  • D
    95% (21)

Explanation

TYPEOF(variant_expression) returns a string describing the Snowflake data type of the value stored in a VARIANT column - for example 'TEXT', 'INTEGER', 'BOOLEAN', 'ARRAY', 'OBJECT', or 'NULL_VALUE'. This is useful when VARIANT columns contain heterogeneous data. CHECK_JSON (A) validates whether a string is valid JSON and returns NULL if valid or an error message if not - it does not inspect a VARIANT's type. IS_ARRAY (B) returns TRUE/FALSE only for arrays. IS_JSON (C) is not a standard Snowflake function.

Topics

#VARIANT data type#TYPEOF function#SQL functions#Semi-structured data

Community Discussion

No community discussion yet for this question.

Full COF-C02 Practice