Cast
The cast transform function transforms the data to a target compatible schema.
The step
name is cast
, and the UserConfig
is controlled here: {"steps": [{"type": "cast", "schema-type": "STRING"}]}
.
Parameters:
Parameter | Description |
---|---|
schema-type |
The target schema type. Only |
part |
when used with KeyValue data, defines if the transform function is done on the |
Example:
-
Produce an AVRO message with the payload:
{field1: value1, field2: value2}
:-
AVRO
-
Result
{"field1": "value1", "field2": "value2"}
{"field1": "value1", "field2": "value2"}
-
-
The function casts the values as a string:
{"field1": "value1", "field2": "value2"}
.
What’s next?
For more, see Transform Functions or the Pulsar documentation.