Drop fields
The drop-fields transform function drops fields of structured data (Currently only AVRO is supported).
The cast transform function transforms the data to a target compatible schema.
The step name is drop-field, and the UserConfig is controlled here: {"steps": [{"type": "drop-fields", "fields": "password,other"}]}.
Parameters:
| Parameter | Description |
|---|---|
fields |
A comma-separated list of fields to drop. |
part |
when used with KeyValue data, defines if the transform function is done on the |
Example
-
Produce an AVRO message with the payload:
{name: value1, password: value2}.-
AVRO
-
Result
{"name": "value1", "password": "value2"}{"name": "value1"} -
-
The function drops the fields specified in the
fieldsparameter, and outputs{"{name: value1}"}to the output topic.
What’s next?
For more, see Transform Functions or the Pulsar documentation.