Amazon Redshift will no longer support the use of Python UDFs after June 30, 2026.
We will start enforcing it in phases. For more information on the details of Python end of life
and migration options, see the
blog post
JSON_SERIALIZE function
The JSON_SERIALIZE function serializes a SUPER expression into textual JSON
representation to follow RFC 8259. For more information on that RFC, see The JavaScript Object
Notation (JSON) Data Interchange Format
The SUPER size limit is approximately the same as the block limit, and the VARCHAR
limit is smaller than the SUPER size limit. Therefore, the JSON_SERIALIZE function
returns an error when the JSON format exceeds the VARCHAR limit of the system. To
check the size of a SUPER expression, see the JSON_SIZE
function.
Syntax
JSON_SERIALIZE(super_expression)
Arguments
- super_expression
-
A
SUPERexpression or column.
Return type
VARCHAR
Note
The returned VARCHAR value is always a non-null JSON string.
If super_expression is NULL, JSON_SERIALIZE returns
the JSON string 'null'.
Examples
To serialize a SUPER value to a string, use the following example.
SELECT JSON_SERIALIZE(JSON_PARSE('[10001,10002,"abc"]'));+---------------------+ | json_serialize | +---------------------+ | [10001,10002,"abc"] | +---------------------+