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

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

                Author: ASF GitHub Bot
            Created on: 05/Jan/22 11:03
            Start Date: 05/Jan/22 11:03
    Worklog Time Spent: 10m 
      Work Description: opwvhk commented on a change in pull request #1381:
URL: https://github.com/apache/avro/pull/1381#discussion_r778732102



##########
File path: lang/java/avro/src/test/java/org/apache/avro/TestSchemas.java
##########
@@ -46,8 +46,8 @@
 
   static final Schema ENUM1_AB_SCHEMA = Schema.createEnum("Enum1", null, null, 
list("A", "B"));
   static final Schema ENUM1_AB_SCHEMA_DEFAULT = Schema.createEnum("Enum1", 
null, null, list("A", "B"), "A");
-  static final Schema ENUM1_AB_SCHEMA_NAMESPACE_1 = Schema.createEnum("Enum1", 
null, "namespace1", list("A", "B"));
-  static final Schema ENUM1_AB_SCHEMA_NAMESPACE_2 = Schema.createEnum("Enum1", 
null, "namespace2", list("A", "B"));
+  public static final Schema ENUM1_AB_SCHEMA_NAMESPACE_1 = 
Schema.createEnum("Enum1", null, "namespace1", list("A", "B"));
+  public static final Schema ENUM1_AB_SCHEMA_NAMESPACE_2 = 
Schema.createEnum("Enum1", null, "namespace2", list("A", "B"));

Review comment:
       Making these public is not a big deal; they're general test values in 
test code.
   
   As a matter of personal preference, I would like to have them all public (or 
none, but that's not an option with the very valid use below).
   
   What is the opinion of others here?




-- 
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: 703870)
    Time Spent: 2h 10m  (was: 2h)

> 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: 2h 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)

Reply via email to