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

ASF GitHub Bot logged work on AVRO-3133:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 22/Oct/21 16:24
            Start Date: 22/Oct/21 16:24
    Worklog Time Spent: 10m 
      Work Description: Adam-McDevitt opened a new pull request #1381:
URL: https://github.com/apache/avro/pull/1381


   Hello! This inconsistency between the schema compatibility checks and the 
resolver has tripped me up a few times, so I'd like to put in a fix for it. I 
didn't get any comments on my original issue and never got around to bumping 
it, so hopefully I've not misinterpreted this as a bug - it does seem to me to 
be an inconsistency with the specification.
   
   ---
   
   Make sure you have checked _all_ steps below.
   
   ### Jira
   
   - [X] My PR addresses the following [Avro 
Jira](https://issues.apache.org/jira/browse/AVRO/) issue and references them in 
the PR title. For example, "AVRO-1234: My Avro PR"
     - https://issues.apache.org/jira/browse/AVRO-3133
     - In case you are adding a dependency, check if the license complies with 
the [ASF 3rd Party License 
Policy](https://www.apache.org/legal/resolved.html#category-x).
   
   ### Tests
   
   - [X] My PR adds the following unit tests __OR__ does not need testing for 
this extremely good reason:
    - unit test to demonstrate that schema compatibility checks are consistent 
with the spec in that they use unqualified namespaces for an ENUM
    - unit test to demonstrate that resolver has been fixed to be consistent 
with the spec, and now uses unqualified namespaces for resolving an ENUM or 
FIXED
   
   ### Commits
   
   - [X] My commits all reference Jira issues in their subject lines. In 
addition, my commits follow the guidelines from "[How to write a good git 
commit message](https://chris.beams.io/posts/git-commit/)":
     1. Subject is separated from body by a blank line
     1. Subject is limited to 50 characters (not including Jira issue reference)
     1. Subject does not end with a period
     1. Subject uses the imperative mood ("add", not "adding")
     1. Body wraps at 72 characters
     1. Body explains "what" and "why", not "how"
   
   ### Documentation
   
   - [X] In case of new functionality, my PR adds documentation that describes 
how to use it.
     - All the public functions and the classes in the PR contain Javadoc that 
explain what it does
    
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

            Worklog Id:     (was: 669028)
    Remaining Estimate: 0h
            Time Spent: 10m

> 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
>          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.3.4#803005)

Reply via email to