Apache NiFi - Transform XML to Avro with Dynamically Inferred Avro Schema

Viewed 54

Using Apache Nifi, I am passing an XML flow file to a ConvertRecord processor, which contains a XMLReader and AvroWriter. The resulting Avro looks almost right, but a few of the values come out null where the source XML had a value. Is there a way to infer the Avro schema without explicitly setting an Avro schema for the AvroWriter since some inbound XML might vary from record to record? I thought that the InferAvroSchema processor could be used, but it says in the docs that it is for json and csv only, so seems like it can't be used to infer Avro schema from XML. Is there a proper sequence to achieve the result of taking XML and converting to Avro with the schema being inferred dynamically?

0 Answers
Related