Categories: Datatype, Variant Type
IS_DOUBLE Preview
Returns TRUE if the input expression is a VARIANT<DOUBLE>.
Syntax
IS_DOUBLE(value VARIANT) → BOOLEAN
- value: The VARIANT value to check.
Examples
IS_DOUBLE exampleSELECT IS_DOUBLE(TO_VARIANT(CAST(1.0 AS DOUBLE)))
-- TRUE
SELECT IS_DOUBLE(TO_VARIANT('hello'))
-- FALSE
Usage Notes
Type checking before extraction
Use IS_DOUBLE to verify a VARIANT contains a double before casting:
SELECT
CASE
WHEN IS_DOUBLE(variant_get(payload, '$.price'))
THEN variant_get(payload, '$.price' AS DOUBLE)
ELSE NULL
END AS price
FROM events;
NULL handling
If the input is SQL NULL (e.g., from a missing path), IS_DOUBLE returns NULL.
| Input | Result |
|---|---|
| VARIANT double | TRUE |
| VARIANT other type | FALSE |
| VARIANT null | FALSE |
| SQL NULL | NULL |