v.19.17New Feature

Add Function Isvalidjson to Check That Passed String Is a Valid Json

Add function isValidJSON to check that passed string is a valid json. #5910 #7293 (Vdimir)
Added the function isValidJSON to verify whether a given string is a valid JSON format.

Why it matters

This function helps users validate JSON strings directly within ClickHouse queries, solving the problem of checking JSON validity without external processing. It enhances data quality checks and preprocessing workflows by enabling quick validation of JSON data.

How to use it

Use the function isValidJSON(string) in your SQL queries to check if the provided string is valid JSON. It returns 1 if the string is a valid JSON and 0 otherwise, for example:

SELECT isValidJSON('{"key": "value"}') AS is_valid;