Hi,There are a couple of PRs available with this feature in the SchemaCompatibility class (which already exists in plain Avro/Java, but is now enhanced with this function). I don't know when they are slated to be included in master, but probably some time after 1.8.2 is release.
https://issues.apache.org/jira/browse/AVRO-1933 https://issues.apache.org/jira/browse/AVRO-2003 Best wishes, /Anders On 2017-04-10 15:00, Mårten Gustafson wrote:
Hi! I'm interested in programatically dealing with schema incompatibilities but I've stranded on ResolvingGrammarGenerator.generate(Schema, Schema). For the case of two incompatible schemas to closest I've been able to get is... Symbol symbol = new ResolvingGrammarGenerator().generate(writeSchema, readSchema); System.err.println(((Symbol.ErrorAction)symbol.production[1]).msg); ...which gives me something like... "Found schema.Test, expecting schema.Test, missing required field id" ...but what I'd like is some programatic representation of the incompatibility. Such as the Field, Schema and something telling me what the problem was (i.e. the field is missing). From casually browsing the source code I can't see how this would be possible today. Is this anything that has been considered? Thanks, Mårten.
smime.p7s
Description: S/MIME Cryptographic Signature