kafka-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ewen Cheslack-Postava (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (KAFKA-4100) Connect Struct schemas built using SchemaBuilder with no fields cause NPE in Struct constructor
Date Tue, 30 Aug 2016 02:09:20 GMT

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

Ewen Cheslack-Postava resolved KAFKA-4100.
------------------------------------------
    Resolution: Fixed

Issue resolved by pull request 1800
[https://github.com/apache/kafka/pull/1800]

> 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