Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

JSON_SERIALIZE_TO_VARBYTE function - Amazon Redshift

JSON_SERIALIZE_TO_VARBYTE function

The JSON_SERIALIZE_TO_VARBYTE function converts a SUPER value to a JSON string similar to JSON_SERIALIZE(), but stored in a VARBYTE value instead.

Syntax

JSON_SERIALIZE_TO_VARBYTE(super_expression)

Arguments

super_expression

A SUPER expression or column.

Return type

VARBYTE

Examples

To serialize a SUPER value and returns the result in VARBYTE format, use the following example.

SELECT JSON_SERIALIZE_TO_VARBYTE(JSON_PARSE('[10001,10002,"abc"]')); +----------------------------------------+ | json_serialize_to_varbyte | +----------------------------------------+ | 5b31303030312c31303030322c22616263225d | +----------------------------------------+

To serialize a SUPER value and casts the result to VARCHAR format, use the following example. For more information, see CAST function.

SELECT CAST((JSON_SERIALIZE_TO_VARBYTE(JSON_PARSE('[10001,10002,"abc"]'))) AS VARCHAR); +---------------------------+ | json_serialize_to_varbyte | +---------------------------+ | [10001,10002,"abc"] | +---------------------------+
PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.