Created on 01-15-2019 05:23 AM - edited 08-17-2019 03:02 PM
Hello,
I am trying to convert multiple json file into csv file in that,
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.
I have tried bellow flow,
1) getFile processor- to get file from source.
2) UpdateAttribute - set attribute schema.name : record
3) inferAvroSchema -configure Schema Output Destination : flowfile-attribute Input Content Type : json
4)convertRecord processor - Record Reader :JsonTreeReader Record Writer :CSVRecordSetWriter
5) putFile : put file into destination folder.
But in above flow getting error in convertRecord Processor,
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.
Please find the attached screen-shot of configuration of convert record processor.
Thanks
Created 01-16-2019 01:20 AM
Make sure you are having ${inferred.avro.schema} attribute is associated with the flowfile.
I am not able to reproduce the error as i recreated same scenario on my end i have tried on NiFi-1.8.0 here is the template of my flow.
Upload the template to your instance and run, Let us know if you are having issue.json-to-csv-232797.xml
Created on 01-16-2019 09:24 AM - edited 08-17-2019 03:02 PM
Hi Shu,
I download the above template and imported into nifi-1.8.0.
when try to drag that template into nifi canvas it gives error.
Thanks in advance
Created 01-16-2019 11:46 AM
Created on 01-16-2019 12:04 PM - edited 08-17-2019 03:01 PM
Hey
still getting error, I am also using same nifi-1.8.0 version
Created 01-16-2019 12:06 PM
if possible please share processor configuration sreen-shot