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

When selecting an array column in QueryRecord, it may return an array of STRINGs when it should be an array of records

    XMLWordPrintableJSON

Details

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

    Description

      Given the following input:

      {
                    "name": "John Doe",
                    "title": "Software Engineer",
                    "age": 40,
                    "addresses": [{
                        "streetNumber": 4820,
                        "street": "My Street",
                        "apartment": null,
                        "city": "New York",
                        "state": "NY",
                        "country": "USA",
                        "label": "work"
                    }, {
                        "streetNumber": 327,
                        "street": "Small Street",
                        "apartment": 309,
                        "city": "Los Angeles",
                        "state": "CA",
                        "country": "USA",
                        "label": "home"
                    }],
                    "project": {
                        "name": "Apache NiFi",
                        "maintainer": {
                              "id": 28302873,
                              "name": "Apache Software Foundation"
                         },
                        "debutYear": 2014
                    }
                  } 

      If I use the following query:

      SELECT addresses FROM FLOWFILE 

      I expect to get the output:

      {
        "addresses" : [ {
          "streetNumber" : 4820,
          "street" : "My Street",
          "apartment" : null,
          "city" : "New York",
          "state" : "NY",
          "country" : "USA",
          "label" : "work"
        }, {
          "streetNumber" : 327,
          "street" : "Small Street",
          "apartment" : 309,
          "city" : "Los Angeles",
          "state" : "CA",
          "country" : "USA",
          "label" : "home"
        } ]
      } 

      But instead the addresses field is something like MapRecord[streetNumber=4820, street=My Street...]

      Attachments

        Issue Links

          Activity

            People

              markap14 Mark Payne
              markap14 Mark Payne
              Votes:
              0 Vote for this issue
              Watchers:
              2 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 - 50m
                  50m