You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Daniel Osvath (Jira)" <ji...@apache.org> on 2021/03/22 23:54:00 UTC

[jira] [Updated] (KAFKA-12522) Cast SMT should allow null values to pass through

     [ https://issues.apache.org/jira/browse/KAFKA-12522?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Osvath updated KAFKA-12522:
----------------------------------
    Description: 
The [current Cast SMT|https://github.com/apache/kafka/blob/trunk/connect/transforms/src/main/java/org/apache/kafka/connect/transforms/Cast.java] fails on a null record value (or a null record key), which is problematic for tombstone records. When a tombstone record reaches the transformation the error below is thrown:

{code:java}
Caused by: org.apache.kafka.connect.errors.DataException: Only Map objects supported in absence of schema for [cast types], found: null
at org.apache.kafka.connect.transforms.util.Requirements.requireMap(Requirements.java:38)
{code}

 Null values should instead be allowed to pass through as there is no cast transformation to be done, with the benefit of supporting tombstone records and allowing the connector to handle the tombstone records as intended. 

  was:The [current Cast SMT|https://github.com/apache/kafka/blob/trunk/connect/transforms/src/main/java/org/apache/kafka/connect/transforms/Cast.java] fails on a null record value (or a null record key), which is problematic for tombstone records. Null values should instead be allowed to pass through as there is no cast transformation to be done, with the benefit of supporting tombstone records. 


> Cast SMT should allow null values to pass through 
> --------------------------------------------------
>
>                 Key: KAFKA-12522
>                 URL: https://issues.apache.org/jira/browse/KAFKA-12522
>             Project: Kafka
>          Issue Type: Bug
>            Reporter: Daniel Osvath
>            Assignee: Daniel Osvath
>            Priority: Minor
>
> The [current Cast SMT|https://github.com/apache/kafka/blob/trunk/connect/transforms/src/main/java/org/apache/kafka/connect/transforms/Cast.java] fails on a null record value (or a null record key), which is problematic for tombstone records. When a tombstone record reaches the transformation the error below is thrown:
> {code:java}
> Caused by: org.apache.kafka.connect.errors.DataException: Only Map objects supported in absence of schema for [cast types], found: null
> at org.apache.kafka.connect.transforms.util.Requirements.requireMap(Requirements.java:38)
> {code}
>  Null values should instead be allowed to pass through as there is no cast transformation to be done, with the benefit of supporting tombstone records and allowing the connector to handle the tombstone records as intended. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)