kafka-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shikhar Bhushan (JIRA)" <j...@apache.org>
Subject [jira] [Created] (KAFKA-4100) Connect Struct schemas built using SchemaBuilder with no fields cause NPE in Struct constructor
Date Mon, 29 Aug 2016 21:53:20 GMT
Shikhar Bhushan created KAFKA-4100:
--------------------------------------

             Summary: Connect Struct schemas built using SchemaBuilder with no fields cause
NPE in Struct constructor
                 Key: KAFKA-4100
                 URL: https://issues.apache.org/jira/browse/KAFKA-4100
             Project: Kafka
          Issue Type: Bug
          Components: KafkaConnect
    Affects Versions: 0.10.0.1
            Reporter: Shikhar Bhushan
            Assignee: Shikhar Bhushan
            Priority: Minor
             Fix For: 0.10.1.0


Avro records can legitimately have 0 fields (though arguable how useful that is).

When using the Confluent Schema Registry's {{AvroConverter}} with such a schema,
{noformat}
java.lang.NullPointerException
	at org.apache.kafka.connect.data.Struct.<init>(Struct.java:56)
	at io.confluent.connect.avro.AvroData.toConnectData(AvroData.java:980)
	at io.confluent.connect.avro.AvroData.toConnectData(AvroData.java:782)
	at io.confluent.connect.avro.AvroConverter.toConnectData(AvroConverter.java:103)
	at org.apache.kafka.connect.runtime.WorkerSinkTask.convertMessages(WorkerSinkTask.java:358)
	at org.apache.kafka.connect.runtime.WorkerSinkTask.poll(WorkerSinkTask.java:227)
	at org.apache.kafka.connect.runtime.WorkerSinkTask.iteration(WorkerSinkTask.java:171)
	at org.apache.kafka.connect.runtime.WorkerSinkTask.execute(WorkerSinkTask.java:143)
	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:471)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)
{noformat}

This is because it is using the {{SchemaBuilder}} to create the Struct schema, which provides
a {{field(..)}} builder for each field. If there are no fields, the list stays as null.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message