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

Update JsonTreeReader to read Records from a Nested Array

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 1.17.0, 1.16.1
    • Extensions
    • None

    Description

      The JsonTreeReader leverages the Jackson JSON streaming API to read one or more records from an InputStream. The supporting RecordReader implementation expects input JSON to be formatted with the an array as the root element, or an object containing the entire Record. This approach supports streamed reading of JSON objects contained within an array as the root element, but does not support streaming of JSON objects contained within an array nested inside a wrapping root object.

      Some services provide JSON responses that include multiple records in a wrapping root object as follows:

      {
        "total": 2,
        "records": [
          {
            "id": 1
          },
          {
            "id": 2
          }
        ]
      }
      

      In order to enable streamed processing of nested records, the JsonTreeReader should be updated to support an optional property defining the Property Name of a nested field containing records.

      Attachments

        Issue Links

          Activity

            People

              Lehel44 Lehel Boér
              exceptionfactory David Handermann
              Votes:
              0 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 - 2h 40m
                  2h 40m