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)…
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)- B5% (1)
- D95% (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
Community Discussion
No community discussion yet for this question.