Search code examples
avro

Is "source" a valid apache AVRO field attribute?


Avro 1.8.2 lists the following record-field-attributes: name, doc, type, default, order and aliases. It does not seem to specify how undefined field names will be handled.

I have inherited .avsc files that include another attribute "source" that has a consistent value of "element" followed by the field name. E.g. for field xyz "source" : "element xyz"

I would like to know if this attribute can be safely deleted? The only difference that the presence or absence of this attribute makes to the generated Java file is to the embedded schema. In fact, I can add any junk attribute with the same result.

The only other reference to an AVRO field-attribute with this name that I have found is on StackOverflow at how to modify AVRO schema to represent a single object instead of list f objects?

Any clues as to the origin of the "source" attribute would also be very helpful.


Solution

  • it is not a valid attribute, you can find here the valid attributes for a schema, remove it should be safe from the "avro" point of view.