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

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

                Author: ASF GitHub Bot
            Created on: 05/Jan/22 10:32
            Start Date: 05/Jan/22 10:32
    Worklog Time Spent: 10m 
      Work Description: Adam-McDevitt commented on a change in pull request 
#1381:
URL: https://github.com/apache/avro/pull/1381#discussion_r778711523



##########
File path: 
lang/java/avro/src/test/java/org/apache/avro/io/parsing/TestResolvingGrammarGenerator.java
##########
@@ -83,6 +83,21 @@ public void testRecordMissingRequiredFieldError() throws 
Exception {
     }
   }
 
+  @Test
+  public void testDifferingEnumNamespaces() throws Exception {
+    Schema enumSchema1 = 
SchemaBuilder.builder().enumeration("Enum").namespace("namespace1").symbols("Symbol1",
+        "Symbol2");
+    Schema enumSchema2 = 
SchemaBuilder.builder().enumeration("Enum").namespace("namespace2").symbols("Symbol1",
+        "Symbol2");

Review comment:
       I added this change in [this 
commit](https://github.com/apache/avro/pull/1381/commits/795b080e9a76f5095300e7a1bccb0b137bfe0067)
 - though it required changing two of the schema static members to be public, 
as they were previously package-protected. I can undo this commit if the small 
inconsistency in visibility is deemed a bit messy, but IMO it's fairly harmless 
since they're only test values.




-- 
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: 703858)
    Time Spent: 1h 40m  (was: 1.5h)

> 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: 1h 40m
>  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)

Reply via email to