Current state: Accepted
Discussion thread: here
Vote thread: here
KIP-907 introduced new SerDes for Booleans in the org.apache.kafka.common.serialization package. This small KIP proposes extending the new SerDes to Kafka Connect, by adding a new org.apache.kafka.connect.converter.BooleanConverter class to convert from/to org.apache.kafka.connect.data.Schema.Type.BOOLEAN types.
A new BooleanConverter class will be added to the org.apache.kafka.connect.converter package implementing the org.apache.kafka.connect.storage.Converter and org.apache.kafka.connect.storage.HeaderConverter interfaces.
Most of the Connect Schema primitive types have converters that are used for serialization. This KIP proposes using the newly added BooleanSerializer / BooleanDeserializer classes to add support for booleans as well. Just like the other converters for primitives, the schema type returned during deserialization will always be an optional boolean schema (a note will be added to the converter's JavaDoc).
Compatibility, Deprecation, and Migration Plan
- As this is a new converter, there's no impact on existing connect users.
- New BooleanConverterTest will be added to the connect/runtime test suite
Users who want to convert from/to Type.BOOLEAN can implement their own converter (the implementation is rather simple)