Support Questions
Find answers, ask questions, and share your expertise
Announcements
Check out our newest addition to the community, the Cloudera Innovation Accelerator group hub.

[Nifi] Basic JSON to AVRO Configuration Understanding

New Contributor

I try to understand how JSON to AVRO work.
I have a basic workflow - https://community.hortonworks.com/storage/attachments/39679-screen-shot-2017-10-05-at-113158-am.png

ExecuteSQL -> ConvertAvroToJSON -> InferAvroSchema -> ConvertJSONtoAvro -> PutAzureBlobStorage

I'm facing cannot find schema error.

https://community.hortonworks.com/storage/attachments/39680-screen-shot-2017-10-05-at-113455-am.png

I have not changed anything for InferAvroSchema.
I added ${inferred.avro.schema} in ConvertJSONtoAvro Record schema

I have also tried output the InferAvroSchema into a output and copy and paste it back to ConvertJSONtoAvro Record schema manually. Also, does not working.
Example:
{"type":"record","name":"NiFi_ExecuteSQL_Record","namespace":"any.data","fields":[ ... Key Value Pairs for name and type ]}

How can I convert JSON to Avro successfully


screen-shot-2017-10-05-at-113158-am.pngscreen-shot-2017-10-05-at-113455-am.png
1 ACCEPTED SOLUTION

New Contributor

Resolved by changing the ConvertAvroToJSON JSON container options to none instead of array.

39684-screen-shot-2017-10-05-at-12207-pm.png

View solution in original post

2 REPLIES 2

New Contributor

I have tried to modify the configuration for InferAvroSchema

39681-screen-shot-2017-10-05-at-121425-pm.png
I have "Schemas for JSON files should be record" error message for ConvertJSONtoAvro

39682-screen-shot-2017-10-05-at-121532-pm.png

New Contributor

Resolved by changing the ConvertAvroToJSON JSON container options to none instead of array.

39684-screen-shot-2017-10-05-at-12207-pm.png