[
https://issues.apache.org/jira/browse/AVRO-1878?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15371749#comment-15371749
]
Doug Cutting commented on AVRO-1878:
------------------------------------
Is your proposal to get rid of Schema#applyAliases and just use the resolver?
If so, I'm not sure it's that simple, since this patch only handles fields, not
records, enums, etc. So we'd need to somehow implement those renamings too in
the resolver. Also, implementing this as the patch does, by adding aliases to
RecordSchema#fieldMap, has other consequences, e.g.,
GenericData.Record#put(String,Object) will now work for aliases as well as
current field names. Is that desirable? Perhaps all alias renaming could be
easily woven into the resolver rather than implemented in a separate pass as it
is now, but the renaming tables should probably be internal to the resolver,
not overloaded into RecordSchema#fieldMap, no?
The current alias behavior is correct. Record names should match. Avro's Java
implementation failed to check these long ago in some cases and that can't be
fixed compatibly. Other implementations may be strict about this. We could
perhaps loosen the record name matching required for aliases to function (as
this patch does) but that seems like a step backwards.
> ResolvingGrammarGenerator doesn't handle aliases
> ------------------------------------------------
>
> Key: AVRO-1878
> URL: https://issues.apache.org/jira/browse/AVRO-1878
> Project: Avro
> Issue Type: Bug
> Components: java
> Affects Versions: 1.8.1
> Reporter: Ryan Blue
> Assignee: Ryan Blue
> Fix For: 1.8.2
>
>
> While testing AVRO-1704, I tested schema evolution using an aliased field and
> found that the ResolvingGrammarGenerator doesn't support field aliases.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)