<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question How to convert json file to csv file using Apache Nifi? in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/How-to-convert-json-file-to-csv-file-using-Apache-Nifi/m-p/242178#M203981</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am trying to convert multiple json file into csv file in that,&lt;/P&gt;&lt;P&gt;In source folder i am getting different json file with different schema.
need to convert json file to csv file with dynamic schema mapping and put that file into destination folder. &lt;/P&gt;&lt;P&gt;I have tried bellow flow,&lt;/P&gt;&lt;P&gt;1) getFile processor- to get file from source. &lt;/P&gt;&lt;P&gt;2) UpdateAttribute - set attribute schema.name : record &lt;/P&gt;&lt;P&gt;3) inferAvroSchema -configure
   Schema Output Destination : flowfile-attribute
   Input Content Type : json &lt;/P&gt;&lt;P&gt;4)convertRecord processor -
   Record Reader :JsonTreeReader
   Record Writer :CSVRecordSetWriter &lt;/P&gt;&lt;P&gt;5) putFile : put file into destination folder.&lt;/P&gt;&lt;P&gt;
But in above flow getting error in convertRecord Processor,&lt;/P&gt;&lt;P&gt;
Error:
 Failed to process StandardFlowFileRecord[uuid=69603ac0-ac43-44b5-82f3-5c1c89e4abaf,claim=StandardContentClaim [resourceClaim=StandardResourceClaim[id=1547526092906-1, container=default, section=1], offset=878, length=878],offset=0,name=orders1.json.avro,size=878]; will route to failure: Failed to create schema from the Schema Text after evaluating FlowFile Attributes.&lt;/P&gt;&lt;P&gt;  Please find the attached screen-shot of configuration of convert record processor.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="96716-csvrecordsetwriter.png" style="width: 1366px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/13619iB27CA2B6C51B4288/image-size/medium?v=v2&amp;amp;px=400" role="button" title="96716-csvrecordsetwriter.png" alt="96716-csvrecordsetwriter.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="96715-jsontreereader.png" style="width: 1366px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/13620iE96097F2A279F65E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="96715-jsontreereader.png" alt="96715-jsontreereader.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="96714-inferavroschema.png" style="width: 1366px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/13621i5C8517A22064AD3E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="96714-inferavroschema.png" alt="96714-inferavroschema.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 17 Aug 2019 22:02:20 GMT</pubDate>
    <dc:creator>waghmithu</dc:creator>
    <dc:date>2019-08-17T22:02:20Z</dc:date>
  </channel>
</rss>

