Ingestion spec - flattenSpec: AVRO record parsing

Hi guys,

Using the last version of Druid I wrote my spec to ingest AVRO records from Kafka. What I’m trying to do also is to make a field flatten but the Druid parser can’t access to it.

The Kafka AVRO record:



My spec:

“flattenSpec”: {
“fields”: [{
“type”: “path”,
“name”: “nestedField”,
“expr”: “$.???.nestedField”


See the question marks in the spec? I’ve tried



as well as



but I get a PathNotFoundException exception.

Do you have any suggestion?

Thank you in advance

Hey there,

You want to escape the dots in the key name by using brackets.




Will get the nestedField in your example. is a handy tool to try out different expressions. (Although I don’t think its parser is exactly the same as what Druid uses)



Hi Dylan,

Thanks for your reply!

I followed your approach too but I still get something like:

com.jayway.jsonpath.PathNotFoundException: Expected to find an object with property [‘deviceName’] in path $[‘device’][‘’] but found ‘null’. This is not a json object according to the JsonProvider: ‘’.


So, none of the following work: .field4.[‘com.bla.bla.bla.Field’].nestedField


I’m checking out the source code to see if I can figure something out. Otherwise I have to locally debug my tasks.

Solved. I hope this is useful for someone else:

A few messages from the Kafka topic contained


`` “com.bla.bla.bla.Field”:null

So the solution was to use the JsonPath wildcard power and set my path to:



Now it works like a charm.