0
votes

I want to convert json data to avro. I have used GenerateFlowFile and put dummy json value [{"firstname":"prathik","age":21},{"firstname":"arun","age":22}]. I have then used ConvertRecord processor and set JsonTreeReader and AvroRecordSetWriter with AvroSchemaRegistry which has the following schema:AvroScehma

But i am getting this as my output: Output (Avro Data)

I am new to Apache Nifi. Thanks in Advance.

1
Set you AvroRecordSetWriter to Embed Avro Schema. Then you should be able to view the converted data (formatted)Christoph Bauer
Thanks for your input. I have set the write strategy in AvroRecordSetWriter as Embedded Avro. And i have received the following output : Objavro.schema€{"type":"record","name":"person","namespace":"nifi","fields":[{"name":"firstname","type":"string"},{"name":"age","type":"int"}]}avro.codecnull¢ÈFB¡-Ž0„Ûv‚L@prathik*arun,¢ÈFB¡-Ž0„Ûv‚L@ Again is red dot.prathik vijaykumar
Which NiFi version are you using? Could you provide the configuration for the JsonTreeReader and AvroRecordSetWriter?Ben Yaakobi

1 Answers

0
votes

But i am getting this as my output: Output (Avro Data)

That's to be expected. Avro is a binary file format, and what you see is an attempt to make that data viewable in a text format. It's supposed to act like that.