Created 11-08-2016 02:53 PM
Hi All,
I'm trying to convert data in JSON to Avro using ConvertJSONToAvro; and for the Avro schema ConvertJSONToAvro processor requires, I'm using InferAvroSchema processor; but I'm getting an error at InferAvroSchema; it throws "org.apache.avro.schemaparseexception illegal character in: avro-schema" error. I looked at the flowfile contents and replaced all attributes names that have a .(dot) with _(underscore), but still no help. Rest of the flowfile data looks ok, so I'm not sure what's causing the exception.
Any thoughts on how to resolve this would be greatly appreciated.
Thanks.
Created 11-08-2016 02:58 PM
Does the term "avro-schema" (from your error message) appear in the schema? If so, then the error is because it doesn't like the dash, you can only use upper- and lower-case letters and underscores for the first character, then that set plus digits for all remaining characters (see Naming section of Avro doc). Try replacing the dash with an underscore and it should work.
Created 11-08-2016 02:58 PM
Does the term "avro-schema" (from your error message) appear in the schema? If so, then the error is because it doesn't like the dash, you can only use upper- and lower-case letters and underscores for the first character, then that set plus digits for all remaining characters (see Naming section of Avro doc). Try replacing the dash with an underscore and it should work.
Created 11-08-2016 03:29 PM
Thanks, that worked.
in InferAvroSchema's Avro Record Name property, I had avro-schema, which I changed to AvroSchema and that did it.
Created 11-08-2016 04:20 PM
I have written up an improvement Jira to add better validation for the Avro Record Name property.
Created 11-08-2016 03:00 PM
@Raj B Is there any chance you can share an example of the JSON message and any stack trace that is output in nifi-app.log?