You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Adam McDevitt (Jira)" <ji...@apache.org> on 2021/12/03 14:16:00 UTC

[jira] [Commented] (AVRO-3133) EnumAdjust.resolve should compare unqualified name rather than full name

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

Adam McDevitt commented on AVRO-3133:
-------------------------------------

Hello. I opened [a PR|https://github.com/apache/avro/pull/1381] for this issue. Just bumping the issue in case it's gone under the radar. The PR is fairly small so should be a quick enough review hopefully.

> EnumAdjust.resolve should compare unqualified name rather than full name
> ------------------------------------------------------------------------
>
>                 Key: AVRO-3133
>                 URL: https://issues.apache.org/jira/browse/AVRO-3133
>             Project: Apache Avro
>          Issue Type: Bug
>          Components: java
>    Affects Versions: 1.10.2
>            Reporter: Adam McDevitt
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Hello
> I came across some unexpected errors after a deployment and have been digging into the Apache Avro source code.
> I think [this comparison|https://github.com/apache/avro/blob/103477369fcb49a5372f9f5c1353fcd575119287/lang/java/avro/src/main/java/org/apache/avro/Resolver.java#L391] in the Enum resolver should use getName rather than getFullName
> The [1.10.2 specification|https://avro.apache.org/docs/1.10.2/spec.html] says, under Schema Resolution:
>  
> {code:java}
> It is an error if the two schemas do not match.
> To match, one of the following must hold:
> - both schemas are arrays whose item types match 
> - both schemas are maps whose value types match 
> - both schemas are enums whose (unqualified) names match 
> - both schemas are fixed whose sizes and (unqualified) names match 
> - both schemas are records with the same (unqualified) name {code}
> i.e. unqualified names should be compared, whereas the linked code compares qualified names
> SchemaCompatibility.checkReaderWriterCompatibility _does_ however use unqualified names in its comparisons. See AVRO-2400 and AVRO-2793. From one of the comments on AVRO-2400 you can see that the specification was not always clear on whether it meant qualified or unqualified names.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)