JSON
The functions to process JSON strings.
| Name and Description |
|---|
is_json(json: string): booleanTests whether a string contains valid JSON. |
json_array_elements(json: string): object<IRowsIterator>Expands the top-level JSON array into a set of values. |
json_array_length(json: string): integerReturns the number of elements in the top-level JSON array. |
json_query(json: string, query: string): stringExtracts an object or an array from a JSON string. |
json_value(json: string, query: string): anyExtracts a scalar value from a JSON string. |
to_json(obj: object): stringConstructs JSON text from object. |
Examples
Query JSON files
select
id,
json_query(Content, '$.request') as r
from '*.json'
where
json_value(Data, '$.method') = 'POST'
and json_value(Content, '$.request.model.RegionID')::int = 14321;"