[
https://issues.apache.org/jira/browse/KAFKA-7052?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17032552#comment-17032552
]
Gunnar Morling commented on KAFKA-7052:
---------------------------------------
Thanks for commenting, [~rhauch]! My intention was to actually keep the current
behavior by means of the default setting of the new option:
* "fail" for records with a schema (it's raising an
{{IllegalArgumentException}} but could be NPE of course if the exact exception
type is a concern; I think it shouldn't, as the original NPE really is a
weakness of the existing implementation that shouldn't be relied upon
* "return-null" for records without schema
I.e. without any explicit setting, the behavior will be exactly be the same as
today (ignoring the changed exception type). That's why I didn't assume that'd
need a KIP, but as per what you're saying, any new option mandates a KIP?
> ExtractField SMT throws NPE - needs clearer error message
> ---------------------------------------------------------
>
> Key: KAFKA-7052
> URL: https://issues.apache.org/jira/browse/KAFKA-7052
> Project: Kafka
> Issue Type: Improvement
> Components: KafkaConnect
> Reporter: Robin Moffatt
> Priority: Major
>
> With the following Single Message Transform:
> {code:java}
> "transforms.ExtractId.type":"org.apache.kafka.connect.transforms.ExtractField$Key",
> "transforms.ExtractId.field":"id"{code}
> Kafka Connect errors with :
> {code:java}
> java.lang.NullPointerException
> at
> org.apache.kafka.connect.transforms.ExtractField.apply(ExtractField.java:61)
> at
> org.apache.kafka.connect.runtime.TransformationChain.apply(TransformationChain.java:38){code}
> There should be a better error message here, identifying the reason for the
> NPE.
> Version: Confluent Platform 4.1.1
--
This message was sent by Atlassian Jira
(v8.3.4#803005)