druid icon indicating copy to clipboard operation
druid copied to clipboard

Getting IllegalArgumentException when using Kafka Indexing service with Confluent Schema registry

Open gurdeep18 opened this issue 10 years ago • 4 comments

I am getting an Illegal Argument exception when posting a supervisor spec using the kafka indexing service.

Here is my snapshot of the spec { "type": "kafka", "dataSchema": { "dataSource": "PinPromo", "parser": { "type": "avro_stream", "avroBytesDecoder": { "type": "schema_registry", "registry": { "url": "http://xx.xx.xxx.xxx:8081", "capacity": 1000 } }, "parseSpec": { "format": "timeAndDims", "timestampSpec": { "column": "eventDate", "format": "auto" }, "dimensionsSpec": { "dimensions":[] } } },

I am getting the following stack trace

2016-11-23T21:55:37,332 INFO [KafkaSupervisor-PinPromo] io.druid.indexing.kafka.supervisor.KafkaSupervisor - Number of tasks [0] does not match configured numReplicas [1] in task group [0], creating more tasks 2016-11-23T21:55:37,338 ERROR [KafkaSupervisor-PinPromo] io.druid.indexing.kafka.supervisor.KafkaSupervisor - KafkaSupervisor[PinPromo] failed to handle notice: {class=io.druid.indexing.kafka.supervisor.KafkaSupervisor, exceptionType=class java.lang.IllegalArgumentException, exceptionMessage=Instantiation of [simple type, class io.druid.data.input.avro.SchemaRegistryBasedAvroBytesDecoder] value failed: null, noticeClass=RunNotice} java.lang.IllegalArgumentException: Instantiation of [simple type, class io.druid.data.input.avro.SchemaRegistryBasedAvroBytesDecoder] value failed: null at com.fasterxml.jackson.databind.ObjectMapper._convert(ObjectMapper.java:2774) ~[jackson-databind-2.4.6.jar:2.4.6] at com.fasterxml.jackson.databind.ObjectMapper.convertValue(ObjectMapper.java:2700) ~[jackson-databind-2.4.6.jar:2.4.6] at io.druid.segment.indexing.DataSchema.getParser(DataSchema.java:102) ~[druid-server-0.9.3-SNAPSHOT.jar:0.9.3-SNAPSHOT] at io.druid.indexing.kafka.KafkaIndexTask.<init>(KafkaIndexTask.java:204) ~[druid-kafka-indexing-service-0.9.3-SNAPSHOT.jar:0.9.3-SNAPSHOT] at io.druid.indexing.kafka.supervisor.KafkaSupervisor.createKafkaTasksForGroup(KafkaSupervisor.java:1275) ~[druid-kafka-indexing-service-0.9.3-SNAPSHOT.jar:0.9.3-SNAPSHOT] at io.druid.indexing.kafka.supervisor.KafkaSupervisor.createNewTasks(KafkaSupervisor.java:1232) ~[druid-kafka-indexing-service-0.9.3-SNAPSHOT.jar:0.9.3-SNAPSHOT] at io.druid.indexing.kafka.supervisor.KafkaSupervisor.runInternal(KafkaSupervisor.java:547) ~[druid-kafka-indexing-service-0.9.3-SNAPSHOT.jar:0.9.3-SNAPSHOT] at io.druid.indexing.kafka.supervisor.KafkaSupervisor$RunNotice.handle(KafkaSupervisor.java:462) ~[druid-kafka-indexing-service-0.9.3-SNAPSHOT.jar:0.9.3-SNAPSHOT]

gurdeep18 avatar Nov 23 '16 22:11 gurdeep18

You may need https://github.com/druid-io/druid/pull/3529 before you can use Confluent's schema registry

fjy avatar Nov 23 '16 22:11 fjy

I have the PR in my distribution.

Is there an example spec on how to specify the schema_registry? Can you confirm if my spec looks correct?

gurdeep18 avatar Nov 23 '16 22:11 gurdeep18

I got this working, had to remove the "registry" from my spec above. Even used flattenSpec with this and it is flattening out my nested kafka schema

gurdeep18 avatar Nov 28 '16 21:11 gurdeep18

@gurdeep18 which format did you use for parseSpec to get the flattenSpec working?

kosii avatar Jan 04 '17 14:01 kosii