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

SpecificData returns incorrect Class type for UNION in schema

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.6.3
    • 1.7.0
    • java

    Description

      Java reflection fails to find the method invoked by the client due to incorrect parameter types.

      This issue arises when a message request field has a UNION type where one type is "null" and the other type is a primitive like "int". In this case, the class type returned by the getClass(Schema) method in SpecificData is int instead of java.lang.Integer which results in a NoSuchMethodException.

      Attachments

        1. SpecificDataWithUnitTests.patch
          3 kB
          Hamed Asghari

        Activity

          People

            hasghari Hamed Asghari
            hasghari Hamed Asghari
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: