> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sdf.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Json Functions

## `is_json_scalar`

Determine if json is a scalar (i.e. a JSON number, a JSON string, true, false or null).

*Supported Signatures*

```sql theme={null}
function is_json_scalar(json) returns boolean
function is_json_scalar(varchar) returns boolean
```

[🔗 Official Documentation](https://trino.io/docs/current/functions/json.html#is_json_scalar)

## `json_array_contains`

Determine if value exists in json (a string containing a JSON array).

*Supported Signatures*

```sql theme={null}
function json_array_contains(json, bigint) returns boolean
function json_array_contains(json, boolean) returns boolean
function json_array_contains(json, double) returns boolean
function json_array_contains(json, varchar) returns boolean
function json_array_contains(varchar, bigint) returns boolean
function json_array_contains(varchar, boolean) returns boolean
function json_array_contains(varchar, double) returns boolean
function json_array_contains(varchar, varchar) returns boolean
```

[🔗 Official Documentation](https://trino.io/docs/current/functions/json.html#json_array_contains)

## `json_array_get`

Warning

*Supported Signatures*

```sql theme={null}
function json_array_get(json, bigint) returns json
function json_array_get(varchar, bigint) returns json
```

[🔗 Official Documentation](https://trino.io/docs/current/functions/json.html#json_array_get)

## `json_array_length`

Returns the array length of json (a string containing a JSON array).

*Supported Signatures*

```sql theme={null}
function json_array_length(json) returns bigint
function json_array_length(varchar) returns bigint
```

[🔗 Official Documentation](https://trino.io/docs/current/functions/json.html#json_array_length)

## `json_extract`

Evaluates the JSONPath-like expression json\_path on json (a string containing JSON) and returns the result as a JSON string.

*Supported Signatures*

```sql theme={null}
function json_extract(json, jsonpath) returns json
function json_extract(varchar, jsonpath) returns json
```

[🔗 Official Documentation](https://trino.io/docs/current/functions/json.html#json_extract)

## `json_extract_scalar`

Like json\_extract(), but returns the result value as a string (as opposed to being encoded as JSON). The value referenced by json\_path must be a scalar (boolean, number or string).

*Supported Signatures*

```sql theme={null}
function json_extract_scalar(json, jsonpath) returns varchar
function json_extract_scalar(varchar, jsonpath) returns varchar
```

[🔗 Official Documentation](https://trino.io/docs/current/functions/json.html#json_extract_scalar)

## `json_format`

Returns the JSON text serialized from the input JSON value. This is inverse function to json\_parse().

*Supported Signatures*

```sql theme={null}
function json_format(json) returns varchar
```

[🔗 Official Documentation](https://trino.io/docs/current/functions/json.html#json_format)

## `json_parse`

Returns the JSON value deserialized from the input JSON text. This is inverse function to json\_format().

*Supported Signatures*

```sql theme={null}
function json_parse(varchar) returns json
```

[🔗 Official Documentation](https://trino.io/docs/current/functions/json.html#json_parse)

## `json_size`

Like json\_extract(), but returns the size of the value. For objects or arrays, the size is the number of members, and the size of a scalar value is zero.

*Supported Signatures*

```sql theme={null}
function json_size(json, jsonpath) returns bigint
function json_size(varchar, jsonpath) returns bigint
```

[🔗 Official Documentation](https://trino.io/docs/current/functions/json.html#json_size)
