Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-3919

AvroTypeUtil throws Exception before trying every possible type

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.2.0
    • 1.3.0
    • Extensions
    • None

    Description

      With a field schema having mixed types, for example, "[null, int, string]", AvroTypeUtil tries to coerce type conversion so that the input raw object can fit with one of possible data type defined in the union.

      If an input string "bar" is passed, we expect it's mapped as "string" data type. However, the "bar" is parsed as integer first, and a NumberFormatException is thrown but not caught, before converting it to "string".

      We surround type conversion with try/catch when AvroTypeUtil tries to find a right type within an union field so that it can check every possible type.

      Attachments

        Issue Links

          Activity

            People

              ijokarumawak Koji Kawamura
              ijokarumawak Koji Kawamura
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: