17.10 - Syntax - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - Data Types and Literals

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1143-171K
Language
English (United States)
{ COMPRESS [ constant | ( { constant | NULL } [,...] ) ] |
  COMPRESS_USING_phrase DECOMPRESS_USING_phrase
} [...]
The order of COMPRESS_USING_phrase and DECOMPRESS_USING_phrase is not important.

Syntax Elements

COMPRESS_USING_phrase
COMPRESS USING [dbname.] compress_udf
DECOMPRESS_USING_phrase
DECOMPRESS USING [dbname.] decompress_udf

COMPRESS With No Arguments

Compress nulls only.

Note that if you do not specify COMPRESS, nulls are not automatically compressed.

Multivalue Compression (MVC) Specification

COMPRESS
Compress column data using multivalue compression.
constant
A set of values to be compressed.
You can specify a single constant value, or a multivalued, comma-separated list of up to 255 distinct constant values enclosed in parentheses.
NULL
Nulls will be compressed.
NULL can be specified alone, but it must be enclosed in parentheses. This is the same as specifying COMPRESS without an argument.
NULL can be specified with up to 255 constant values in a multivalued, comma-separated list enclosed in parentheses.

Algorithmic Compression (ALC) Specification

COMPRESS USING
Compress column data using algorithmic compression.
DECOMPRESS USING
Decompress column data that was previously compressed using algorithmic compression.
dbname
The name of the database in which the compress or decompress user-defined function (UDF) is stored. If a database name is not specified, the default database used is SYSUDTLIB.
You should create all compress and decompress UDFs in the SYSUDTLIB database. Note that compression functions supplied by Teradata are located in TD_SYSFNLIB.
compress_udf
The name of the UDF used to compress values in the column.
decompress_udf
The name of the UDF used to decompress values in the column.