Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

[Nifi] Basic JSON to AVRO Configuration Understanding

avatar
New Member

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

avatar
New Member

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

avatar
New Member

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

avatar
New Member

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

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