Skip to content

Add Hash SMT #9

@ivanyu

Description

@ivanyu

Often it's useful to be able to replace some string value with its hash in order to, for example, anonymize the record. We need to add Hash SMT for this.

Here's a scratch of the documentation for it that specifies it:

Hash

This transformation replaces a string value with its hash.

The transformation can hash either the whole key or value (in this case, it must have STRING type) or a field in them (in this case, it must have STRUCT type and the field's value must be STRING).

Exists in two variants:

  • io.aiven.kafka.connect.transforms.Hash$Key - works on keys;
  • io.aiven.kafka.connect.transforms.Hash$Value - works on values.

The transformation defines the following configurations:

  • field.name - The name of the field which value should be hashed. If null or empty, the entire key or value is used (and assumed to be a string). By default is null.
  • function - The name of the hash function to use. The supported values are: md5, sha1.

Here is an example of this transformation configuration:

transforms=HashEmail
transforms.HashEmail.type=io.aiven.kafka.connect.transforms.Hash$Value
transforms.HashEmail.field.name=email
transforms.HashEmail.function=sha1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions