p-kimberley commented on code in PR #7603:
URL: https://github.com/apache/nifi/pull/7603#discussion_r1294529921


##########
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/DeduplicateRecord.java:
##########
@@ -544,34 +534,28 @@ private void sendOrRemove(ProcessSession session,
         }
     }
 
-    private String executeDynamicRecordPaths(ProcessContext context, Record 
record, FlowFile flowFile) {
+    private String evaluateKeyFromDynamicProperties(ProcessContext context, 
Record record, FlowFile flowFile) {
         final List<String> fieldValues = new ArrayList<>();
         for (final PropertyDescriptor propertyDescriptor : dynamicProperties) {
             final String value = 
context.getProperty(propertyDescriptor).evaluateAttributeExpressions(flowFile).getValue();
             final RecordPath recordPath = recordPathCache.getCompiled(value);
             final RecordPathResult result = recordPath.evaluate(record);
             final List<FieldValue> selectedFields = 
result.getSelectedFields().collect(Collectors.toList());
 
+            // Add the name of the dynamic property
             fieldValues.add(propertyDescriptor.getName());
 
+            // Add any non-null record field values
             fieldValues.addAll(selectedFields.stream()
-                    .map(f -> f.getValue().toString())
-                    .collect(toList())
+                    .map(f -> f.getValue() != null ? f.getValue().toString() : 
"")

Review Comment:
   I realise the code output differs from what the comment suggests - will fix 
so `null` fields are filtered out



-- 
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