Closed travisbrown closed 2 years ago
@travisbrown You might want to read this - https://github.com/flavray/avro-rs/pull/99#issuecomment-1017195592
@martin-g Ah, thanks. I saw the general status change but not that specific fix. I'll take a closer look.
This is a sketch of an approach that could be used to fix #182.
The problem is that the library replaces every name reference in a schema with the full definition, and the Avro tooling for Java (and possibly other platforms) considers these "redefinitions" and fails when it sees them.
I think there are two ways to fix this:
This PR does the latter, which is much less invasive. When the schema is being written to the Avro file, it only writes the first definition for each record type, and replaces the rest with the full name.
This PR is a quick sketch that is currently untested and only handles records (not enums or fixeds), since I just wanted to make sure it solves the problem in my case (at first glance it seems to) and to check whether a change like this would be considered.