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

Null as default value in avro generates exception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.17.0
    • Core Framework
    • None

    Description

      When I have a record without value for fields, then missing fields will be populated with default values from schema. It was added in https://issues.apache.org/jira/browse/NIFI-4030

      But when null is default value then avro 1.8.1 returns org.apache.avro.JsonProperties$Null which cannot be converted to null value (the issue in avro is described in https://issues.apache.org/jira/browse/AVRO-1954) and processors fail with error:

      ERROR o.a.n.p.standard.ConvertRecord - ConvertRecord[id=37460cbe-17f1-4456-a6b9-f4ed1baa4c45] Failed to process FlowFile[0,436030859382835.mockFlowFile,161B]; will route to failure: org.apache.avro.file.DataFileWriter$AppendWriteException: org.apache.avro.AvroRuntimeException: Unknown datum type org.apache.avro.JsonProperties$Null: org.apache.avro.JsonProperties$Null@1723f29f
      

      Probably Apache Nifi should upgrade to newer avro or backport the fix from avro 1.9.x to AvroTypeUtil

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              alien11689 Dominik Przybysz
              Votes:
              2 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 - 1.5h
                  1.5h