Semi-structured Data Types that is supported by Snowflake

Semi-structured Data Types that Snowflake support are VARIANT,OBJECT,ARRAY.
These data types are used to represent arbitrary data structures which can be used to import and operate on semi-structured data (JSON, Avro, ORC, Parquet, or XML).

VARIANT : Universal type, which can store values of any other type, including OBJECT and ARRAY, up to a maximum size of 16 MB compressed. A value of any data type can be implicitly cast to a VARIANT value, subject to size restrictions. When a VARIANT value and a NUMERIC value are coerced into the same type, the NUMERIC value is cast to VARIANT.
create table table (float1 float, var1 variant, float2 float);

OBJECT : Used to represent collections of key-value pairs, where the key is a non-empty string, and the value is a value of VARIANT type. Snowflake does not currently support explicitly-typed objects.

ARRAY : Used to represent dense or sparse arrays of arbitrary size, where index is a non-negative integer (up to 2^31-1), and values have VARIANT type. Snowflake does not currently support fixed-size arrays or arrays of elements of a specific non-VARIANT type.

Author: user

Leave a Reply

Your email address will not be published. Required fields are marked *