JSON

The functions to process JSON strings.

Name and Description
is_json(json: string): boolean

Tests 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): integer

Returns the number of elements in the top-level JSON array.
json_query(json: string, query: string): string

Extracts an object or an array from a JSON string.
json_value(json: string, query: string): any

Extracts a scalar value from a JSON string.
to_json(obj: object): string

Constructs 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;"