mattyb149 commented on code in PR #8266:
URL: https://github.com/apache/nifi/pull/8266#discussion_r1458090443


##########
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/LookupRecord.java:
##########
@@ -487,7 +487,13 @@ public Set<Relationship> lookup(final Record record, final 
ProcessContext contex
                 final RecordPath recordPath = entry.getValue();
 
                 final RecordPathResult pathResult = 
recordPath.evaluate(record);
-                final List<FieldValue> lookupFieldValues = 
pathResult.getSelectedFields()
+                final List<FieldValue> allFieldValues = 
pathResult.getSelectedFields().toList();
+                if (allFieldValues.isEmpty()) {

Review Comment:
   I was able to get this "working" by just changing line 503 to `continue;` 
after setting `hasUnmatchedValue = true`, removing the temp `rels` variable and 
updating the debug line. That avoids having to call `toList()` and then 
`stream()` later. But since it should not be an unmatched value, that's less 
than ideal too.
   
   I think the crux of the issue is that `getSelectedFields()` returns an empty 
list, when it should return a field with an `Object[0]` in it. This is a result 
of `WildcardIndexPath:67` which generates the empty list instead of a singleton 
list with a empty array in it. We could add a check for `array.length == 0` 
there and return the one-element empty array instead.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to