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

MergeRecord processor ignoring writer schema for JsonRecordSetWriter output

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.17.0
    • Extensions
    • None

    Description

      Issue noticed when using a MergeRecord processor with a Record Reader of CSVReader and a Record Writer of JsonRecordSetWriter.

      The CSVReader is configured with a Schema Access Strategy of "Use String Fields From Header". The JsonRecordSetWriter is given an Avro schema in the Schema Text property that contains a mix of string, double, and long value types.

      Running sample csv data through the MergeRecord processor produces JSON in which all values are quoted, despite the Avro schema specifying otherwise. However, when using the ConvertRecord processor with the same Reader/Writer config, the output JSON records use the typing given in the avro schema, keeping long and float values unquoted.

      The attached template, with corresponding avro schema and sample input csv file will demonstrate the issue.

      Attachments

        1. MergeContent_JsonOutput.xml
          35 kB
          Nick Pettyjohn
        2. test.csv
          0.2 kB
          Nick Pettyjohn
        3. test_schema.avsc
          0.4 kB
          Nick Pettyjohn

        Issue Links

          Activity

            People

              mattyb149 Matt Burgess
              nmpetty Nick Pettyjohn
              Votes:
              0 Vote for this issue
              Watchers:
              5 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 - 0.5h
                  0.5h