<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: NiFi: Merge Header and Data coming from different FlowFiles in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Merge-Header-and-Data-coming-from-different-FlowFiles/m-p/198695#M83485</link>
    <description>&lt;A rel="user" href="https://community.cloudera.com/users/53213/mustafaqizilbash.html" nodeid="53213" target="_blank"&gt;@Mustafa Ali Qizilbash&lt;/A&gt;&lt;P&gt;For this case using &lt;STRONG&gt;EnforceOrder &lt;/STRONG&gt;processor we can achieve your required file.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;FLow:&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="91417-flow.png" style="width: 1646px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17756iFB4061375390B637/image-size/medium?v=v2&amp;amp;px=400" role="button" title="91417-flow.png" alt="91417-flow.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In this flow &lt;STRONG&gt;EnforceOrder &lt;/STRONG&gt;processor enforce to get header flowfile first then actual data flowfile and using MergeContent processor we are merging them into one.&lt;/P&gt;&lt;P&gt;Change the Wait Timeout property value in EnforceOrder processor as pre your requirement.&lt;/P&gt;&lt;P&gt;I have attached the template xml in this thread,you can keep as reference for your flow.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.cloudera.com/legacyfs/online/attachments/91418-enforce-order.xml" target="_blank"&gt;enforce-order.xml&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 18 Aug 2019 06:07:37 GMT</pubDate>
    <dc:creator>Shu_ashu</dc:creator>
    <dc:date>2019-08-18T06:07:37Z</dc:date>
    <item>
      <title>NiFi: Merge Header and Data coming from different FlowFiles</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Merge-Header-and-Data-coming-from-different-FlowFiles/m-p/198692#M83482</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/18929/yaswanthmuppireddy.html" nodeid="18929"&gt;@Shu&lt;/A&gt; &lt;A rel="user" href="https://community.cloudera.com/users/641/mburgess.html" nodeid="641"&gt;@Matt Burgess&lt;/A&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We have 2 files coming from different locations.&lt;/P&gt;&lt;P&gt;1) First one is coming containing Header (column names only)&lt;/P&gt;&lt;P&gt;2) Second one is having Data, in the same column sequence.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Aim:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;We need to merge both in one output file, where Header comes on top (in first row) and data from 2 row on wards.&lt;/P&gt;&lt;P&gt;Looking forward.&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;</description>
      <pubDate>Thu, 13 Sep 2018 23:23:58 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Merge-Header-and-Data-coming-from-different-FlowFiles/m-p/198692#M83482</guid>
      <dc:creator>mustafa_qizilba</dc:creator>
      <dc:date>2018-09-13T23:23:58Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi: Merge Header and Data coming from different FlowFiles</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Merge-Header-and-Data-coming-from-different-FlowFiles/m-p/198693#M83483</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/53213/mustafaqizilbash.html" nodeid="53213" target="_blank"&gt;@Mustafa Ali Qizilbash&lt;/A&gt;
&lt;/P&gt;&lt;P&gt;You can acheive this case by using MergeContent processor &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Merge Content Configs:&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="91415-mergecontent.png" style="width: 1738px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17757i0F48DA00D94ABD16/image-size/medium?v=v2&amp;amp;px=400" role="button" title="91415-mergecontent.png" alt="91415-mergecontent.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;By configuring Minimum Number of Entries to 2 processor will wait until it got 2 entries.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Flow that i tried:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="91412-flow.png" style="width: 2132px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17758iD22E1D6D65C5096E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="91412-flow.png" alt="91412-flow.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But if we got 2 flowfiles from Location1 it self merge content is going to merge those flowfiles into 1.&lt;/P&gt;&lt;P&gt;This flow only works when we are going to have one flowfile from each source then it works fine, if you haven't got any flowfile from location2 then processor just wait infinite time until it gets another flowfile.&lt;/P&gt;&lt;P&gt;To avoid this case use reasonable Max bin age time for your use case then processor will forcefully keeps the flow file into merged relationship.&lt;/P&gt;&lt;P&gt;Please refer to &lt;A href="https://community.hortonworks.com/questions/64337/apache-nifi-merge-content.html" target="_blank" rel="nofollow noopener noreferrer"&gt;this&lt;/A&gt; link for configuring MergeContent processor.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(or)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;If your header is always same:&lt;/U&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;1.With new record oriented processor capabilities you can ignore the header that is coming from Location1 and configure the ConvertRecord processor to add the header to the incoming data.&lt;/P&gt;&lt;P&gt;2.Using Replace text processor we can add the header from to the Location2 file.&lt;/P&gt;&lt;P&gt;Refer to &lt;A href="https://community.hortonworks.com/questions/191116/nifi-how-to-add-custom-header-to-csv-file.html" target="_blank" rel="nofollow noopener noreferrer"&gt;this&lt;/A&gt; link for more details regards to this method.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 06:07:51 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Merge-Header-and-Data-coming-from-different-FlowFiles/m-p/198693#M83483</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2019-08-18T06:07:51Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi: Merge Header and Data coming from different FlowFiles</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Merge-Header-and-Data-coming-from-different-FlowFiles/m-p/198694#M83484</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/18929/yaswanthmuppireddy.html" nodeid="18929"&gt;@Shu&lt;/A&gt; &lt;/P&gt;&lt;P&gt;Thanks, the merged worked but header came as a last row.&lt;/P&gt;&lt;P&gt;How to prioritize the header FlowFile to come top as data header (as column names)&lt;/P&gt;</description>
      <pubDate>Fri, 14 Sep 2018 01:38:24 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Merge-Header-and-Data-coming-from-different-FlowFiles/m-p/198694#M83484</guid>
      <dc:creator>mustafa_qizilba</dc:creator>
      <dc:date>2018-09-14T01:38:24Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi: Merge Header and Data coming from different FlowFiles</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Merge-Header-and-Data-coming-from-different-FlowFiles/m-p/198695#M83485</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/53213/mustafaqizilbash.html" nodeid="53213" target="_blank"&gt;@Mustafa Ali Qizilbash&lt;/A&gt;&lt;P&gt;For this case using &lt;STRONG&gt;EnforceOrder &lt;/STRONG&gt;processor we can achieve your required file.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;FLow:&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="91417-flow.png" style="width: 1646px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17756iFB4061375390B637/image-size/medium?v=v2&amp;amp;px=400" role="button" title="91417-flow.png" alt="91417-flow.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In this flow &lt;STRONG&gt;EnforceOrder &lt;/STRONG&gt;processor enforce to get header flowfile first then actual data flowfile and using MergeContent processor we are merging them into one.&lt;/P&gt;&lt;P&gt;Change the Wait Timeout property value in EnforceOrder processor as pre your requirement.&lt;/P&gt;&lt;P&gt;I have attached the template xml in this thread,you can keep as reference for your flow.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.cloudera.com/legacyfs/online/attachments/91418-enforce-order.xml" target="_blank"&gt;enforce-order.xml&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 06:07:37 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Merge-Header-and-Data-coming-from-different-FlowFiles/m-p/198695#M83485</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2019-08-18T06:07:37Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi: Merge Header and Data coming from different FlowFiles</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Merge-Header-and-Data-coming-from-different-FlowFiles/m-p/198696#M83486</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/18929/yaswanthmuppireddy.html" nodeid="18929" target="_blank"&gt;@Shu&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Followed and implemented but getting the error at the same place where you are showing in your snapshot. Kindly advice how to fix.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="91419-enforceorderfailed.png" style="width: 1590px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17753iA5F7AFE28A53AA30/image-size/medium?v=v2&amp;amp;px=400" role="button" title="91419-enforceorderfailed.png" alt="91419-enforceorderfailed.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;UpdateAttribute_Header&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="91421-updateattribute-header.png" style="width: 1600px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17754i8164E428ECFC7A69/image-size/medium?v=v2&amp;amp;px=400" role="button" title="91421-updateattribute-header.png" alt="91421-updateattribute-header.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;UpdateAttribute_Data&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="91423-updateattribute-data.png" style="width: 1600px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17755i341BD938B7F9E03B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="91423-updateattribute-data.png" alt="91423-updateattribute-data.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 06:07:29 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Merge-Header-and-Data-coming-from-different-FlowFiles/m-p/198696#M83486</guid>
      <dc:creator>mustafa_qizilba</dc:creator>
      <dc:date>2019-08-18T06:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi: Merge Header and Data coming from different FlowFiles</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Merge-Header-and-Data-coming-from-different-FlowFiles/m-p/198697#M83487</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/53213/mustafaqizilbash.html" nodeid="53213" target="_blank"&gt;@Mustafa Ali Qizilbash&lt;/A&gt;
&lt;/P&gt;&lt;P&gt;I think issue is with &lt;STRONG&gt;Order Attribute&lt;/STRONG&gt; as this property &lt;STRONG&gt;doesn't accept expression language&lt;/STRONG&gt; so use attribute name without expression language.&lt;/P&gt;&lt;P&gt;Make sure you are having enforce order configs as&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="91424-eo.png" style="width: 1589px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17752iBE3475BA39D5FD2F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="91424-eo.png" alt="91424-eo.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Change the &lt;STRONG&gt;Wait &lt;/STRONG&gt;Timeout property value in EnforceOrder processor as pre your requirement.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 06:07:10 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Merge-Header-and-Data-coming-from-different-FlowFiles/m-p/198697#M83487</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2019-08-18T06:07:10Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi: Merge Header and Data coming from different FlowFiles</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Merge-Header-and-Data-coming-from-different-FlowFiles/m-p/198698#M83488</link>
      <description>&lt;P&gt;Many thanks, it worked.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Sep 2018 05:25:32 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Merge-Header-and-Data-coming-from-different-FlowFiles/m-p/198698#M83488</guid>
      <dc:creator>mustafa_qizilba</dc:creator>
      <dc:date>2018-09-14T05:25:32Z</dc:date>
    </item>
  </channel>
</rss>

