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

Darryl Green commented on AVRO-1340:
------------------------------------

Anyone who needs this feature (the ability to extend enums) by definition needs 
new implementations. As use of the feature is entirely optional I don't really 
understand the rationale for this requiring an Avro 2.0 release. But ok. I'm 
just looking for a way to get this to progress. 

What WOULD be an acceptable change? I expect the pull request by [~ksenji] is 
not ok in its current form as it changes the semantics of specifying a default 
value; requires that any extensible enum have a default value (something it 
wouldn't necessarily have); and requires that unknown values be mapped to the 
default (I can easily imagine cases where the value I want to default to is not 
the value I want if I read a value I don't expect). That said, its better than 
no extensibility.

Whatever it is, I need it to actually make it into an Avro release and working 
for multiple languages (C++, java and javascript) to truly solve my problem, so 
guidance on what would potentially be acceptable would help....



> 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
(v6.3.15#6346)

Reply via email to