Is Avro SpecificRecord (i.e., generated Java classes) compatible with schema evolution? That is, if I have an Avro message source (in my case, kafka), and I want to deserialize these messages to a specific registry, is it safe to do this?
What I see:
- adding a field to the end of the circuit works fine - can deserialize ok to specificrecord
- adding a field to the middle does not break existing customers
Even if the messages are compatible, this is a problem.
If I can find a new schema (using, for example, a resident system registry), I can deserialize to GenericRecord, but there seems to be no way to match genericrecord to specificrecord from another schema.
MySpecificType message = (T SpecificData.get().deepCopy(MySpecificType.SCHEMA$, genericMessage);
Deepcopy is mentioned in various places, but it uses an index, so it does not work.
Is there a safe way to map between two avro objects when you have both circuits and they are compatible? Even if I could display from genercrecord to genericrecord, it would do as I could do a deep stunt trick to complete the job.
source share