Created 02-11-2017 01:18 PM
Hi Friends,
Needed a help here.
I have picked up one of the xmls lying in the trafficLocs_data_for_simulator.zip.
My objective is to convert XML to Avro format. The tutorials has shown us how to convert XML to JSON format by using AttributesToJSON processor.
I am facing issue while configuring ConvertJSONToAvro processor.
I have used the Record Schema as mentioned below -
{ "type": "record", "name" : "first", "namespace" : "xml", "fields" : [{"name" : "Direction_of_Travel", "type" : "string" }, { "name" : "Latitude", "type" : "float" }, { "name" : "Longitude", "type" : "float" }, { "name" : "Vehicle_ID", "type" : "integer" }, { "name" : "Vehicle_Speed"," type" : "integer" }] }
I am getting red alert symbol mentioning it as Failed to Parse Record Schema.
Any pointers will help.
Thanks,
Ankur K
Created 02-12-2017 04:48 AM
Created 06-29-2018 08:46 PM
Hey @rajat puchnanda
First I would recommend extracting the attributes from JSON using EvaluateJSONPath processor, then utilize AttributesToCSV processor to represent the FlowFile attributes as CSV format.
For seeing how to use evaluateJSONPath processor, check out this part of the tutorial series:
https://hortonworks.com/tutorial/analyze-transit-patterns-with-apache-nifi/section/5/
AttributesToCSV processor is similar to AttributesToJSON processor, the following tutorial shows how to use AttributesToJSON, apply the similar idea to using AttributesToCSV processor:
https://hortonworks.com/tutorial/analyze-transit-patterns-with-apache-nifi/section/6/
For info on AttributesToCSV processor:
Created 06-29-2018 04:57 PM
Any thoughts?