-
Notifications
You must be signed in to change notification settings - Fork 27
Closed
Description
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. Ifnull
or empty, the entire key or value is used (and assumed to be a string). By default isnull
.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
nick-zh and brbrown25
Metadata
Metadata
Assignees
Labels
No labels