You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Christophe Taton (JIRA)" <ji...@apache.org> on 2013/10/17 07:12:42 UTC

[jira] [Resolved] (AVRO-1385) Enum reader/writer resolution doesn't report errors

     [ https://issues.apache.org/jira/browse/AVRO-1385?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christophe Taton resolved AVRO-1385.
------------------------------------

    Resolution: Invalid

The Java Avro API implements strict validation at decoding time, not at schema resolution time, so I'll mark this issue as invalid.

In KijiSchema, we need strict validation at schema resolution time, so as to determine whether a reader schema is guaranteed to decode any datum encoded using a given writer schema.

We implemented this validation here: https://github.com/kijiproject/kiji-schema/blob/master/kiji-schema/src/main/java/org/kiji/schema/util/AvroUtils.java#L334

We're happy to contribute this to Avro if there is interest.
C.

> 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)