Scalar function
SQL NULL, empty text and whitespace-only text return SQL NULL. Text containing JSON null produces a VARIANT JSON-null value distinct from SQL NULL.
Syntax
Scalar
Snowflake (scalar)
Arguments
Scalar
Snowflake
Returns
- Type: VARIANT
- NULL behavior: SQL NULL, empty text and whitespace-only text return SQL NULL. Text containing JSON null produces a VARIANT JSON-null value distinct from SQL NULL.
- Shape: A VARIANT scalar, object, or array. This is a VARIANT value rather than an ordinary SQL STRUCT.
- Ordering: Array element order is preserved; object-key order is not a SQL ordering guarantee.
Properties
Usage notes
- Default strict mode rejects duplicate object keys. Snowflake mode may select last-write-wins duplicate handling using a constant mode argument.
- Fractional JSON numbers are encoded as DOUBLE instead of fixed-point decimal.
- Deterministic: The same inputs and settings produce the same result.
Examples
Typical behavior
Read a nested value after parsing
Limitations
- A VARIANT value’s total encoded size is limited to 128 MiB.
- Only Snowflake context supports the optional mode argument. Modes s/S and d/D are recognized; NULL, nonconstant or other mode values are argument errors even for TRY_PARSE_JSON.
- PARSE_JSON raises a per-row parsing error; TRY_PARSE_JSON converts per-row parsing failures to NULL but does not suppress argument validation errors.
Last modified on October 15, 2026