[prev in list] [next in list] [prev in thread] [next in thread] 

List:       avro-user
Subject:    Re: Java: Programatic representation of schema validation errors?
From:       Anders Sundelin <anders.sundelin () ericsson ! com>
Date:       2017-04-10 13:26:22
Message-ID: bf1c5208-3582-8766-93ab-cd9472dde36c () ericsson ! com
[Download RAW message or body]


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" (application/pkcs7-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic