Function Description
is_variant_null(expr) Check if a variant value is a variant null. Returns true if and only if the input is a variant null and false otherwise (including in the case of SQL NULL).
parse_json(jsonStr) Parse a JSON string as a Variant value. Throw an exception when the string is not valid JSON value.
schema_of_variant(v) Returns schema in the SQL format of a variant.
schema_of_variant_agg(v) Returns the merged schema in the SQL format of a variant column.
to_variant_object(expr) Convert a nested input (array/map/struct) into a variant where maps and structs are converted to variant objects which are unordered unlike SQL structs. Input maps can only have string keys.
try_parse_json(jsonStr) Parse a JSON string as a Variant value. Return NULL when the string is not valid JSON value.
try_variant_get(v, path[, type]) Extracts a sub-variant from `v` according to `path`, and then cast the sub-variant to `type`. When `type` is omitted, it is default to `variant`. Returns null if the path does not exist or the cast fails.
variant_explode(expr) It separates a variant object/array into multiple rows containing its fields/elements. Its result schema is `struct`. `pos` is the position of the field/element in its parent object/array, and `value` is the field/element value. `key` is the field name when exploding a variant object, or is NULL when exploding a variant array. It ignores any input that is not a variant array/object, including SQL NULL, variant null, and any other variant values.
variant_explode_outer(expr) It separates a variant object/array into multiple rows containing its fields/elements. Its result schema is `struct`. `pos` is the position of the field/element in its parent object/array, and `value` is the field/element value. `key` is the field name when exploding a variant object, or is NULL when exploding a variant array. It ignores any input that is not a variant array/object, including SQL NULL, variant null, and any other variant values.
variant_get(v, path[, type]) Extracts a sub-variant from `v` according to `path`, and then cast the sub-variant to `type`. When `type` is omitted, it is default to `variant`. Returns null if the path does not exist. Throws an exception if the cast fails.