16.20 - Example: Compressing JSON Data Types - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Operators and User-Defined Functions

Product
Advanced SQL Engine
Teradata Database
Release Number
16.20
Release Date
April 2020
Content Type
Administration
Programming Reference
Publication ID
B035-1210-162K
Language
English (United States)

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);