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

LookUpRecord record path evaluation is "breaking" the next evaluation in case data is missing

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.26.0, 2.0.0-M3
    • Extensions
    • None
    • Apache NiFi custom built from Github repo.

    Description

      Input JSON generated by GenerateFlowFile processor looks like this (actually I just added a currencies array under each record in addition to the "Record Update Strategy - Replace Existing Values" example here https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.15.0/org.apache.nifi.processors.standard.LookupRecord/additionalDetails.html).

      Note: for the first record currencies array is empty.

       

      [
        {
          "locales": [
            {
              "region": "FR",
              "language": "fr"
            }, {
              "region": "US",
              "language": "en"
            }
          ],
          "currencies": []
        }, {
          "locales": [
            {
              "region": "CA",
              "language": "fr"
            }, 
            {
              "region": "JP",
              "language": "ja"
            }
          ],
          "currencies": [
            {
              "currency": "CAD"
            }, {
              "currency": "JPY"
            }
          ]
        }
      ]

       

      SimpleKeyValueLookUp service contains the following values:

       

      LookUpRecord processor is configured as follows: 

      Once I execute the LookUpRecord processor for the flow file, language look up works fine, but the look up for currencies and regions do not work.

       

      Note: in case the 1st currencies array is not empty but contains { "currency": "EUR" }, { "currency": "USD" }, all look up works fine. But a missing data seems to break the next evaluation of the record path.

      Please find the template for reproducing the issue enclosed as "LookUpRecord_empty_array_data_issue.xml".

      Thank you.

       

      Attachments

        1. LookUpRecord_empty_array_data_issue.xml
          37 kB
          Peter Molnar
        2. image-2022-02-11-12-33-23-283.png
          24 kB
          Peter Molnar
        3. image-2022-02-11-12-32-01-833.png
          28 kB
          Peter Molnar
        4. image-2022-02-11-12-30-53-134.png
          56 kB
          Peter Molnar

        Issue Links

          Activity

            People

              jrsteinebrey Jim Steinebrey
              pem Peter Molnar
              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 - 1h 10m
                  1h 10m