[ 
https://issues.apache.org/jira/browse/AVRO-1385?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13792257#comment-13792257
 ] 

Doug Cutting commented on AVRO-1385:
------------------------------------

Perhaps an error should only be thrown when an enum symbol not in the reader's 
schema is read?

The spec says, "if the writer's symbol is not present in the reader's enum, 
then an error is signalled".

A related issue is the handling of unions.  If the reader's union contains a 
subset of the branches of the writer, should an exception be thrown at 
resolution time or only when an instance of a missing branch is encountered?  
By Postel's law, we should perhaps throw an error at read-time, not at 
resolve-time.  If you have an enum symbol or union branch you've never used it 
might be nice to be able to remove it.

> Enum reader/writer resolution doesn't report errors
> ---------------------------------------------------
>
>                 Key: AVRO-1385
>                 URL: https://issues.apache.org/jira/browse/AVRO-1385
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.7.5
>            Reporter: Christophe Taton
>         Attachments: 
> AVRO-1385.base=a56e7f13c4fa976b7926649b058665f42850a349.20131010-182234.patch
>
>
> According to the specification, when a reader enum does not contain all 
> symbols from the writer enum, an error should be signaled.
> ResolvingGrammarGenerator fails to report such errors.
> In particular, mkEnumAdjust() silently maps unknown symbols of the writers 
> with symbols named "No match for [writer symbol]".
> https://github.com/apache/avro/blob/trunk/lang/java/avro/src/main/java/org/apache/avro/io/parsing/ResolvingGrammarGenerator.java#L409
> Shouldn't this instead create an ErrorAction?



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to