COMPRESS

functionsupportedCore SQL functions

docs.snowflake.com ↗

String & binary functions

Compresses the input string or binary value with a compression method.

Syntax

COMPRESS(<input>, <method>)

Parameters

NameRequiredDescription
inputrequiredA BINARY or string value (or expression) to be compressed.
methodrequiredA string with compression method and optional compression level. Supported methods are: SNAPPY. ZLIB. ZSTD. BZ2. The compression level is specified in parentheses, for example: zlib(1). The compression level is a non-negative integer. 0 means default level (same as omitting the compression level). The compression level is ignored if the method doesn’t support compression levels.

Returns

A BINARY with compressed data.

Usage notes

See also

Referenced by