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]
Created on
02-11-2017
01:18 PM
- last edited on
04-21-2026
05:25 AM
by
GrazittiAPI
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?