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

ASF subversion and git services commented on AVRO-1340:
-------------------------------------------------------

Commit 238714d324d1623f144ca09c0dfb10330a2ba2c4 in avro's branch 
refs/heads/master from [~abellemare]
[ https://gitbox.apache.org/repos/asf?p=avro.git;h=238714d ]

AVRO-1340. Java: Add enum defaults, including builder & IDL support.

* AVRO-1340: Added Enum Defaults and unit tests.

* AVRO-1340: Added support for enum defaults to SchemaBuilder

* AVRO-1340: Added ResolvingVisitor enum default, introduces an attempt at the 
idl.jj for enum default but tests not passing for simple.avdl

* AVRO-1340: Added override annotation to getEnumDefault() implementation

* AVRO-1340: Added Doug Cutting\'s fix to the idl.jj for Avro enum parsing. 
Added test case to simple.avdl and simple.avpr

* AVRO-1340: Updated docs, updated the reserved keywords for enums so that the 
@default annotation no longer works on enum avdl definitions. Updated the way 
that SchemaBuilder allows an enum to be built sith a default by separating out 
the default setter.

* AVRO-1340: Updated the docs and verified that the generated doc is readable 
and well-formatted.

* AVRO-1340: Updated the enum type check to a reasonable, sane check.

* AVRO-1340: Added the missing  semicolon to enum doc


> use default to allow old readers to specify default enum value when 
> encountering new enum symbols
> -------------------------------------------------------------------------------------------------
>
>                 Key: AVRO-1340
>                 URL: https://issues.apache.org/jira/browse/AVRO-1340
>             Project: Avro
>          Issue Type: Improvement
>          Components: spec
>         Environment: N/A
>            Reporter: Jim Donofrio
>            Priority: Minor
>
> The schema resolution page says:
> > if both are enums:
> > if the writer's symbol is not present in the reader's enum, then an
> error is signalled.
> This makes it difficult to use enum's because you can never add a enum value 
> and keep old reader's compatible. Why not use the default option to refer to 
> one of enum values so that when a old reader encounters a enum ordinal it 
> does not recognize, it can default to the optional schema provided one. If 
> the old schema does not provide a default then the older reader can continue 
> to fail as it does today.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to