Adam McDevitt created AVRO-3133:
-----------------------------------

             Summary: 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


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

Have I misunderstood something here? 
SchemaCompatibility.checkReaderWriterCompatibility uses unqualified namespaces 
in its comparisons. See AVRO-2400 and AVRO-2793. From this comment 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