CAN_JSON_PARSE function - Amazon Redshift
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

CAN_JSON_PARSE function

The CAN_JSON_PARSE function parses data in JSON format and returns true if the result can be converted to a SUPER value using the JSON_PARSE function.

Syntax

CAN_JSON_PARSE( {json_string | binary_value} )

Arguments

json_string

An expression that returns serialized JSON in the VARBYTE or VARCHAR form.

binary_value

A VARBYTE type binary value.

Return type

BOOLEAN

Examples

To see if the JSON array [10001,10002,"abc"] can be converted into the SUPER data type, use the following example.

SELECT CAN_JSON_PARSE('[10001,10002,"abc"]'); +----------------+ | can_json_parse | +----------------+ | true | +----------------+