Skip to main content

UNCOMPRESS

Description

The UNCOMPRESS function is used to COMPRESS binary data into strings or values, you need to make sure that the binary data needs to be the result of 'compress'.

Syntax

UNCOMPRESS(<compressed_str>)

Parameters

ParametersDescription
<compressed_str>Compressed binary data, parameter type is varchar or string

Return Value

The return value is the same as the input compressed_str type

Special cases:

  • compressed_str Returns NULL if the binary data is not compressed.

Example

select uncompress(compress('abc'));
+-----------------------------+
| uncompress(compress('abc')) |
+-----------------------------+
| abc |
+-----------------------------+
select uncompress(compress(''));
+--------------------------+
| uncompress(compress('')) |
+--------------------------+
| |
+--------------------------+
select uncompress(compress(abc));
+-------------------+
| uncompress('abc') |
+-------------------+
| NULL |
+-------------------+