- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Merge Attribute values from FlowFiles
- Labels:
-
Apache NiFi
Created on
‎03-18-2020
02:16 PM
- last edited on
‎03-18-2020
07:02 PM
by
ask_bill_brooks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello together,
I splitted a flow file for each x value.
With value x I fetch value y and set it to the Attribute.
Is it possible if I merge the FlowFiles together, that the Attribute values can be merged comma-seperated too?
Created ‎03-25-2020 02:37 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Faerballert
Perhaps you clone your flowfile before the mergeContent processors. So whichever relationship you are connecting to your current mergeContent, you drag a second connection containing that same relationship to a parallel notification flow.
Down this parallel flow path you use a replaceText processor to replace the content with the value from the attribute you want to merge. Then you use a mergeContent processor on this path to merge these files using a "," as your delimiter. Then from this mergeContent you do you notification.
You may also want to open an Apache Jira with your use case and desired improvement for the existing mergeContent. The more details the better.
Hope this helps,
Matt
Created ‎03-24-2020 12:02 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The NiFi merge based processors only offer the option to "Keep Common Attributes" (keeps on attributes were every merged file has same attributes with same value) or "Keep all Unique Attributes" (same as above, but will also keep attributes that is unique. This means any attribute that exists in 1 or more of the merged FlowFiles were the value assigned to that attribute is the same in cases where attribute was found on more than one FlowFile being merged).
There is no option to merge all attributes creating a comma separated list of unique values. What is the use case for such a n attribute merge need? There is no way to tell which value goes with which chunk of the merged data. Plus if the merged FlowFile were later split, every produced split FlowFile would have all the same FlowFile attributes.
Hope this helps,
Matt
Created ‎03-25-2020 08:28 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks @MattWho for your answer.
The goal for me is to create an output with the merged attributes so that I can notify myself what elements have been edited.
My thought was to mail me something like this:
Postion 1,2,3,5,8,13 has been changed
*1,2,3,5,8,13 are the attribute values of each flowfile
Dont know how i can solve this otherwise in one Flow/Notification
Created ‎03-25-2020 02:37 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Faerballert
Perhaps you clone your flowfile before the mergeContent processors. So whichever relationship you are connecting to your current mergeContent, you drag a second connection containing that same relationship to a parallel notification flow.
Down this parallel flow path you use a replaceText processor to replace the content with the value from the attribute you want to merge. Then you use a mergeContent processor on this path to merge these files using a "," as your delimiter. Then from this mergeContent you do you notification.
You may also want to open an Apache Jira with your use case and desired improvement for the existing mergeContent. The more details the better.
Hope this helps,
Matt
