[
https://issues.apache.org/jira/browse/NIFI-9677?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17811456#comment-17811456
]
ASF subversion and git services commented on NIFI-9677:
-------------------------------------------------------
Commit 59ff1b6561863c500283d665e9675979b065e78b in nifi's branch
refs/heads/main from jsteinebrey
[ https://gitbox.apache.org/repos/asf?p=nifi.git;h=59ff1b6561 ]
NIFI-9677 Fixed issue that an empty JSON array causes flow file to be
considered unmatched even though it should be considered as a match.
Refactored to avoid streaming over the list twice.
Tweaked unit test, so it works in NiFi 1.x also.
Signed-off-by: Matt Burgess <[email protected]>
This closes #8266
> LookUpRecord record path evaluation is "breaking" the next evaluation in case
> data is missing
> ---------------------------------------------------------------------------------------------
>
> Key: NIFI-9677
> URL: https://issues.apache.org/jira/browse/NIFI-9677
> Project: Apache NiFi
> Issue Type: Bug
> Components: Extensions
> Environment: Apache NiFi custom built from Github repo.
> Reporter: Peter Molnar
> Assignee: Jim Steinebrey
> Priority: Major
> Attachments: LookUpRecord_empty_array_data_issue.xml,
> image-2022-02-11-12-30-53-134.png, image-2022-02-11-12-32-01-833.png,
> image-2022-02-11-12-33-23-283.png
>
> Time Spent: 1h 10m
> Remaining Estimate: 0h
>
> 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.
>
> {code:java}
> [
> {
> "locales": [
> {
> "region": "FR",
> "language": "fr"
> }, {
> "region": "US",
> "language": "en"
> }
> ],
> "currencies": []
> }, {
> "locales": [
> {
> "region": "CA",
> "language": "fr"
> },
> {
> "region": "JP",
> "language": "ja"
> }
> ],
> "currencies": [
> {
> "currency": "CAD"
> }, {
> "currency": "JPY"
> }
> ]
> }
> ]{code}
>
> SimpleKeyValueLookUp service contains the following values:
> !image-2022-02-11-12-33-23-283.png!
>
> LookUpRecord processor is configured as follows:
> !image-2022-02-11-12-30-53-134.png!
> 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.
>
> !image-2022-02-11-12-32-01-833.png!
> *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.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)