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

Cannot convert Avro schemas to Record schemas with default value in arrays

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.5.0
    • 1.6.0
    • Core Framework
    • None
    • ALL
    • Important

    Description

      Given an Avro Schema that has a default array defined, it is not possible to be converted to a Nifi Record Schema.

      To reproduce the bug, try to convert the following Avro schema to Record Schema:

      {
          "type": "record",
          "name": "Foo1",
          "namespace": "foo.namespace",
          "fields": [
              {
                  "name": "listOfInt",
                  "type": {
                      "type": "array",
                      "items": "int"
                  },
                  "doc": "array of ints",
                  "default": 0
              }
          ]
      }
      

       
      Using org.apache.nifi.avro.AvroTypeUtil class. Attached a maven project to reproduce the issue and also the fix.

      • To reproduce the bug, run "mvn clean test"
      • To test the fix, run "mvn clean test -Ppatch".

       

      Attachments

        1. issue1.zip
          12 kB
          Gardella Juan Pablo

        Issue Links

          Activity

            People

              gardellajuanpablo Gardella Juan Pablo
              gardellajuanpablo Gardella Juan Pablo
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: