Unwrap KeyValue
If the record value is a KeyValue, the unwrap-key-value transform function extracts the KeyValue’s key or value and makes it the record value.
The step name is unwrap-key-value
, and the UserConfig
is controlled here: {"steps": [{"type": "unwrap-key-value"}]}
.
Parameters:
Parameter | Description |
---|---|
unwrapKey |
By default, the KeyValue’s value is unwrapped. Set this parameter to |
Example
-
Produce an AVRO message with the payload:
{key={keyField: key}, value={valueField: value}}
.-
AVRO
-
Result
{key={keyField: key}, value={valueField: value}}
{"valueField": "value"}
-
-
The function extracts the KeyValue’s key and outputs
{valueField: value}
to the output topic.
What’s next?
For more, see Transform Functions or the Pulsar documentation.