Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

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.

Read from Kafka, convert data from JSON to CSV and write to HADOOP

avatar
New Member

Hi,

I'm looking for tutorial for the following flow:

1. Read message from Kafka (JSON format)

2. Convert the JSON format to CSV format

3. Write the CSV to Hadoop

It's possible to do it with Nifi?

Thanks.

1 ACCEPTED SOLUTION

avatar
Master Guru

@Ya ko

Yes,it's possible with record oriented processors(Convert Record) NiFi,

Flow:

1. Consume Kafka Processor //to read data from Kafka
2. Convert Record processor //to convert json format to csv format
3. PutHDFS //write the csv format data to HDFS

In ConvertRecord processor we are configuring Record Reader(Json Tree Reader) to read incoming Json format data and Record writer Controller service(CSVSetWriter) to write the output flowfile in CSV format, we need to define Avro schema for the Record Reader/Writer controller services.

Follow this tutorial to know more details and configurations regarding Convert record processor.

View solution in original post

2 REPLIES 2

avatar
Master Guru

@Ya ko

Yes,it's possible with record oriented processors(Convert Record) NiFi,

Flow:

1. Consume Kafka Processor //to read data from Kafka
2. Convert Record processor //to convert json format to csv format
3. PutHDFS //write the csv format data to HDFS

In ConvertRecord processor we are configuring Record Reader(Json Tree Reader) to read incoming Json format data and Record writer Controller service(CSVSetWriter) to write the output flowfile in CSV format, we need to define Avro schema for the Record Reader/Writer controller services.

Follow this tutorial to know more details and configurations regarding Convert record processor.

avatar
New Member

Thank you!