This documentation is related to an older version of Firebolt. For the most current documentation, see Firebolt documentation.
JSON_EXTRACT_RAW
Returns a string representation of the scalar or sub-object under the key indicated by <json_pointer_expression>
if the key exists. If the key does not exist, returns NULL
.
Syntax
JSON_EXTRACT_RAW(<json>, <json_pointer_expression>)
Parameters
Parameter | Description | Supported input types |
---|---|---|
<json> | The JSON document from which the array is to be extracted. | TEXT |
<json_pointer_expression> | A JSON pointer to the location of the array in the JSON. For more information, see JSON pointer expression syntax. | TEXT |
Return Types
- If key is provided, returns
TEXT
- If no key is provided, returns
NULL
Example
For the JSON document indicated by <json_common_example>
below, see JSON common example. The Returns result is based on this common example.
SELECT
JSON_EXTRACT_RAW(<json_common_example>,'/value/dyid')
Returns: 987
JSON_EXTRACT_RAW(<json_common_example>, '/value/tagIdToHits')
Returns: {"map":{"1737729":32,"1775582":35}}