Important

You are viewing documentation for an older version of Confluent Platform. For the latest, click here.

Cast

Description

Cast fields or the entire key or value to a specific type. For example, this can be used to force an integer field into an integer of smaller width. Only simple primitive types are supported, such as integer, float, boolean, and string. Use the concrete transformation type designed for the record key (org.apache.kafka.connect.transforms.Cast$Key) or value (org.apache.kafka.connect.transforms.Cast$Value).

You can configure Java streams applications to deserialize and ingest data in multiple ways, including Kafka console producers, JDBC source connectors, and Java client producers. For full code examples, see connect-streams-pipeline.

Properties

Name Description Type Default Valid Values Importance
spec A single type to cast the entire value, or for Maps and Structs the comma-separated list of field names and the type to which they should be cast, of the form field1:type1,field2:type2. Valid types are int8, int16, int32, int64, float32, float64, boolean, and string. list   comma-separated list of colon-delimited pairs of field:type, e.g. foo:int32,bar:string high