Skip to content

Checks if the input JSON value is a boolean.

func.is_boolean(<expr>)
func.is_boolean(func.parse_json('true')), func.is_boolean(func.parse_json('[1,2,3]'))
┌────────────────────────────────────────────────────────────────────────────────────────┐
│ func.is_boolean(func.parse_json('true')) │ func.is_boolean(func.parse_json('[1,2,3]')) │
├──────────────────────────────────────────┼─────────────────────────────────────────────┤
│ true │ false │
└────────────────────────────────────────────────────────────────────────────────────────┘
IS_BOOLEAN( <expr> )

Returns true if the input JSON value is a boolean, and false otherwise.

SELECT
IS_BOOLEAN(PARSE_JSON('true')),
IS_BOOLEAN(PARSE_JSON('[1,2,3]'));
┌────────────────────────────────────────────────────────────────────┐
│ is_boolean(parse_json('true')) │ is_boolean(parse_json('[1,2,3]')) │
├────────────────────────────────┼───────────────────────────────────┤
│ true │ false │
└────────────────────────────────────────────────────────────────────┘