Formats a JSON value with line breaks and indentation for readability.
Syntax
string json_pretty(<json>)Parameters
| Parameter | Required | Description |
|---|---|---|
json | Yes | The JSON value to format. |
Returns
STRING
Examples
JSON object
SELECT json_pretty(json '{"a":1, "b":2}');Result:
+-----+
| _c0 |
+-----+
| {
"a":1,
"b":2
} |
+-----+Related functions
json_pretty is a complex type function. For more information about functions for processing ARRAY, MAP, STRUCT, and JSON data, see Complex type functions.