[ https://issues.apache.org/jira/browse/KAFKA-8523?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16931646#comment-16931646 ]
Randall Hauch commented on KAFKA-8523: -------------------------------------- It seems strange to me that InsertField into a null (tombstone) record would create an empty map / struct. Rather, it seems like we need a configuration property that defines the behavior on null. However, that means we need a small KIP to define this property. I'd suggest a property like `behavior.on.null` whose values are either `empty` or `skip`. If we consider records with null values as tombstones (meaning they represent deleted records), defaulting to `skip` makes the most sense to me. We do have a similar problem with `ExtractField` (see KAFKA-7052), and it'd be great if the KIP added that configuration item there as well. > InsertField transformation fails when encountering tombstone event > ------------------------------------------------------------------ > > Key: KAFKA-8523 > URL: https://issues.apache.org/jira/browse/KAFKA-8523 > Project: Kafka > Issue Type: Bug > Components: KafkaConnect > Reporter: Gunnar Morling > Priority: Major > > When applying the {{InsertField}} transformation to a tombstone event, an > exception is raised: > {code} > org.apache.kafka.connect.errors.DataException: Only Map objects supported in > absence of schema for [field insertion], found: null > at > org.apache.kafka.connect.transforms.util.Requirements.requireMap(Requirements.java:38) > at > org.apache.kafka.connect.transforms.InsertField.applySchemaless(InsertField.java:138) > at > org.apache.kafka.connect.transforms.InsertField.apply(InsertField.java:131) > at > org.apache.kafka.connect.transforms.InsertFieldTest.tombstone(InsertFieldTest.java:128) > {code} > AFAICS, the transform can still be made working in in this case by simply > building up a new value map from scratch. -- This message was sent by Atlassian Jira (v8.3.2#803003)