How to convert JSON into csv using apache nifi

Here I am showing how to get a JSON file ,parse it and convert it into CSV file format and store it into HDFS. This is the complete flow.

Here I am getting file using ‘GetFile’ processor and parsing it using ‘EvaluateJSON’ processor. Next step is to convert it into csv format using ‘ReplaceText’ processor and write our file format as csv file format

Next step is give a filename with .csv extention to your flow file using ‘UpdateAttribute’ processor


Now merge all flowfile into a single csv file using ‘MergeContent’ processor and put it into HDFS using ‘PUTHDFS’ processor


Now u’l get a single csv file into HDFS location for your JSON datafile




Leave a Reply

Your email address will not be published. Required fields are marked *