Add support for deduplicating definitions in schemas#202
Closed
travisbrown wants to merge 1 commit intoflavray:mainfrom
Closed
Add support for deduplicating definitions in schemas#202travisbrown wants to merge 1 commit intoflavray:mainfrom
travisbrown wants to merge 1 commit intoflavray:mainfrom
Conversation
|
@travisbrown You might want to read this - #99 (comment) |
Author
|
@martin-g Ah, thanks. I saw the general status change but not that specific fix. I'll take a closer look. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.