brimdata / zync

Kafka connector to sync Zed lakes to and from Kafka topics
BSD 3-Clause "New" or "Revised" License
18 stars 3 forks source link

encode repeated record as reference in zavro.EncodeSchema #46

Closed nwt closed 2 years ago

nwt commented 2 years ago

For a Zed type containing two identical records (e.g, {a:{},b:{}}) zavro.EncodeSchema returns a schema containing two records with the same name, which is something schema registries don't allow. Change EncodeSchema to use avro.RecursiveSchema for any Zed record type previously encountered so that subsequent appearances of a record type become references (rather than duplicates) in the returned schema.