Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-3133

EnumAdjust.resolve should compare unqualified name rather than full name

    XMLWordPrintableJSON

Details

    Description

      Hello

      I came across some unexpected errors after a deployment and have been digging into the Apache Avro source code.

      I think this comparison in the Enum resolver should use getName rather than getFullName

      The 1.10.2 specification says, under Schema Resolution:

       

      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 

      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.

      Attachments

        Issue Links

          Activity

            People

              adammcdevitt Adam McDevitt
              adammcdevitt Adam McDevitt
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2h 50m
                  2h 50m