exceptionfactory commented on code in PR #8992:
URL: https://github.com/apache/nifi/pull/8992#discussion_r1712056901


##########
nifi-extension-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/GetS3ObjectMetadata.java:
##########
@@ -166,14 +168,22 @@ public void onTrigger(ProcessContext context, 
ProcessSession session) throws Pro
                 Map<String, Object> combinedMetadata = new 
HashMap<>(metadata.getRawMetadata());
                 combinedMetadata.putAll(metadata.getUserMetadata());
 
-                if (!isRouter && 
context.getProperty(METADATA_TARGET).getValue().equals(TARGET_ATTRIBUTES.getValue()))
 {
+                if 
(context.getProperty(METADATA_TARGET).getValue().equals(TARGET_ATTRIBUTES.getValue()))
 {
                     String attributePrefix = 
context.getProperty(METADATA_ATTRIBUTE_PREFIX).getValue();
                     Map<String, String> newAttributes = combinedMetadata
                             .entrySet().stream()
+                            .filter(e -> {
+                                if (attributePattern == null) {
+                                    return true;
+                                } else {
+                                    return 
attributePattern.matcher(attributePrefix + e.getKey())
+                                            .find();

Review Comment:
   It seems like the match should only consider `e.getKey()`, and the prefix 
should be added after, as it is now.



##########
nifi-extension-bundles/nifi-aws-bundle/nifi-aws-processors/src/main/java/org/apache/nifi/processors/aws/s3/GetS3ObjectMetadata.java:
##########
@@ -94,12 +80,23 @@ public class GetS3ObjectMetadata extends 
AbstractS3Processor {
             .required(true)
             .build();
 
+    public static final PropertyDescriptor ATTRIBUTE_INCLUDE_PATTERN = new 
PropertyDescriptor.Builder()
+            .name("Attribute Include Pattern")

Review Comment:
   For consistency, naming this `Metadata Include Pattern` would help indicate 
that it used to match against to the S3 Metadata Key, as opposed to the 
FlowFile Attribute. Or to cover both bases, `Metadata Attribute Include 
Pattern`.



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