[
https://issues.apache.org/jira/browse/AVRO-1340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16421420#comment-16421420
]
Bridger Howell commented on AVRO-1340:
--------------------------------------
[~felixgv]: I don't think the semantics of this implementation are complicated,
although the chart is hard to read.
Here are the basic principles that explain this:
* Field defaults allow records to be able to read record schemas that are
missing a field (by providing a value to use when this condition holds). This
has not changed.
* Enum defaults allow enums to be able to read enum schemas that have more
symbols (by providing a fallback value to use when this condition holds).
* Unusable defaults should be disallowed at parse time.
I think the second semantic is very useful for allowing readers to handle
writer enum changes without breaking, where those enum changes are otherwise
unimportant to whatever guarantee the a reader might need to provide.
If you could point to an instance in the "Final Default & Fallback" table that
you think is particularly confusing or unacceptable, I think that would be
helpful to this discussion.
> 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)