[
https://issues.apache.org/jira/browse/KAFKA-4709?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15859017#comment-15859017
]
Tegan Snyder commented on KAFKA-4709:
-------------------------------------
Is there any way to figure out the field that is causing this error? I'm also
receiving this error message when using the JDBC Source connector. Thanks.
{code}
org.apache.kafka.connect.errors.DataException: Invalid value: null used for
required field
at
org.apache.kafka.connect.data.ConnectSchema.validateValue(ConnectSchema.java:212)
at org.apache.kafka.connect.data.Struct.put(Struct.java:215)
at org.apache.kafka.connect.data.Struct.put(Struct.java:204)
at
io.confluent.connect.jdbc.source.DataConverter.convertFieldValue(DataConverter.java:433)
at
io.confluent.connect.jdbc.source.DataConverter.convertRecord(DataConverter.java:73)
at
io.confluent.connect.jdbc.source.TimestampIncrementingTableQuerier.extractRecord(TimestampIncrementingTableQuerier.java:184)
at
io.confluent.connect.jdbc.source.JdbcSourceTask.poll(JdbcSourceTask.java:195)
at
org.apache.kafka.connect.runtime.WorkerSourceTask.execute(WorkerSourceTask.java:155)
at
org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:140)
at org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:175)
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
{code}
> Error message from Struct.validate() should include the name of the offending
> field.
> ------------------------------------------------------------------------------------
>
> Key: KAFKA-4709
> URL: https://issues.apache.org/jira/browse/KAFKA-4709
> Project: Kafka
> Issue Type: Improvement
> Components: KafkaConnect
> Reporter: Jeremy Custenborder
> Assignee: Jeremy Custenborder
> Priority: Minor
>
> Take a look at this repro.
> {code}
> @Test
> public void structValidate() {
> Schema schema = SchemaBuilder.struct()
> .field("one", Schema.STRING_SCHEMA)
> .field("two", Schema.STRING_SCHEMA)
> .field("three", Schema.STRING_SCHEMA)
> .build();
> Struct struct = new Struct(schema);
> struct.validate();
> }
> {code}
> Any one of the fields could be causing the issue. The following exception is
> thrown. This makes troubleshooting missing fields in connectors much more
> difficult.
> {code}
> org.apache.kafka.connect.errors.DataException: Invalid value: null used for
> required field
> {code}
> The error message should include the field or fields in the error message.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)