<a id="gzipdecompress"></a>

# Kafka Connect GzipDecompress SMT Usage Reference for Confluent Platform

The `GzipDecompress` SMT (`io.confluent.connect.transforms.GzipDecompress`)
decompresses a Gzip-compressed byte array back to its original uncompressed
byte array.

#### NOTE
GzipDecompress is not available for [managed connectors](https://docs.confluent.io/cloud/current/connectors/index.html).

## Description

The `GzipDecompress` SMT decompresses a byte-array input that was previously
Gzip-compressed. It works only with byte-array (`BYTES`) input.

The SMT decompresses the input using `java.util.zip.GZIPInputStream` and
returns the resulting byte array.

Based on your requirements, use the transformation type designed for the
record key (`io.confluent.connect.transforms.GzipDecompress$Key`) or the
record value (`io.confluent.connect.transforms.GzipDecompress$Value`).

## Installation

Confluent develops this transformation and does not ship it by default
with Apache Kafka® or Confluent Platform.
You can install this transformation using the
[confluent connect plugin
install](https://docs.confluent.io/confluent-cli/current/command-reference/connect/plugin/confluent_connect_plugin_install.html)
command:

```bash
confluent connect plugin install confluentinc/connect-transforms:latest
```

## Examples

The following example shows how to configure and use `GzipDecompress`.

### Gzip-decompress a byte-array value

This configuration snippet shows how to decompress a Gzip-compressed value.

```json
"transforms": "gzipDecompress",
"transforms.gzipDecompress.type": "io.confluent.connect.transforms.GzipDecompress$Value"
```

Because the values are binary, this example uses base64 to display them as
readable text. To prepare the input, encode the text `Hello world` as
base64, then Gzip-compress the result:

```bash
# Encode "Hello world" as base64
echo "Hello world" | base64
# Output: SGVsbG8gd29ybGQK

# Gzip-compress the base64-encoded value
echo "SGVsbG8gd29ybGQK" | gzip
```

The SMT decompresses the Gzip-compressed value back to the base64-encoded text:

- Before: the Gzip-compressed bytes produced by compressing `SGVsbG8gd29ybGQK`
- After: `SGVsbG8gd29ybGQK` (the base64 encoding of `Hello world`)

## Predicates

Configure transformations with predicates to ensure they process only records
that satisfy a particular condition. You can also use predicates in a
transformation chain with the [Kafka Connect Filter (Kafka) SMT Usage Reference for Confluent Platform](filter-ak.md#ak-filter) to conditionally filter specific
records. For more information, see [Predicates](filter-ak.md#predicates).
