Example: Compressing JSON Data Types - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
Language
English (United States)
Last Update
2024-04-03
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

Although you can call the function directly, JSON_COMPRESS is often used with the COMPRESS USING phrase to compress table columns. In the following table, the JSON data in the json_col column is compressed using the JSON_COMPRESS function.

CREATE TABLE temp (
   id        INTEGER, 
   json_col  JSON(1000) 
             CHARACTER SET LATIN 
             COMPRESS USING JSON_COMPRESS
             DECOMPRESS USING JSON_DECOMPRESS);