<?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 ] Convert the flowfile content to an attribute in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/NIFI-Convert-the-flowfile-content-to-an-attribute/m-p/345421#M234522</link>
    <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/94636"&gt;@IslamGamal&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Keep in mind that all the FlowFile attributes for a FlowFile are held in NiFi's JVM heap memory.&amp;nbsp; Creating large attributes on your FlowFiles can quickly eat up a lot of heap memory and affect JVM performance.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Matt&lt;/P&gt;</description>
    <pubDate>Fri, 10 Jun 2022 19:43:13 GMT</pubDate>
    <dc:creator>MattWho</dc:creator>
    <dc:date>2022-06-10T19:43:13Z</dc:date>
    <item>
      <title>[ NIFI ] Convert the flowfile content to an attribute</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NIFI-Convert-the-flowfile-content-to-an-attribute/m-p/345414#M234518</link>
      <description>&lt;P&gt;Hello everyone&lt;/P&gt;&lt;P&gt;i have a content in Json (an array of id)&lt;/P&gt;&lt;P&gt;[{"id":7532233},{"id":755163}]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and i need to convert this whole array into one attribute so that i can after that refer to it in an ExecuteSql processor with statement :&lt;/P&gt;&lt;P&gt;update column 1&amp;nbsp; where id exists(${attributeName})&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 18:53:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NIFI-Convert-the-flowfile-content-to-an-attribute/m-p/345414#M234518</guid>
      <dc:creator>IslamGamal</dc:creator>
      <dc:date>2022-06-10T18:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: [ NIFI ] Convert the flowfile content to an attribute</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NIFI-Convert-the-flowfile-content-to-an-attribute/m-p/345420#M234521</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;If I understood your question correctly, you want to place the file content into an attribute and store it in sql? If that is the case you can use ExtractText Processor. there you add dynamic property lets call it "&lt;STRONG&gt;IdArray&lt;/STRONG&gt;" and set the regular expression to "&lt;STRONG&gt;(?s)(^.*$)&lt;/STRONG&gt;" to capture everything in the file. Just be careful there is a size limit set of 1 MB to be captured if you think your data will be more then you can increase it. Hope that helps, if so please accept solution.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 19:35:43 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NIFI-Convert-the-flowfile-content-to-an-attribute/m-p/345420#M234521</guid>
      <dc:creator>SAMSAL</dc:creator>
      <dc:date>2022-06-10T19:35:43Z</dc:date>
    </item>
    <item>
      <title>Re: [ NIFI ] Convert the flowfile content to an attribute</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NIFI-Convert-the-flowfile-content-to-an-attribute/m-p/345421#M234522</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/94636"&gt;@IslamGamal&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Keep in mind that all the FlowFile attributes for a FlowFile are held in NiFi's JVM heap memory.&amp;nbsp; Creating large attributes on your FlowFiles can quickly eat up a lot of heap memory and affect JVM performance.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Matt&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 19:43:13 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NIFI-Convert-the-flowfile-content-to-an-attribute/m-p/345421#M234522</guid>
      <dc:creator>MattWho</dc:creator>
      <dc:date>2022-06-10T19:43:13Z</dc:date>
    </item>
    <item>
      <title>Re: [ NIFI ] Convert the flowfile content to an attribute</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NIFI-Convert-the-flowfile-content-to-an-attribute/m-p/345423#M234524</link>
      <description>&lt;P&gt;Thanks alot SAMSAL. It actually worked&lt;/P&gt;&lt;P&gt;but I've a two points if u can help me&lt;BR /&gt;1. since am not regex professional, is there a regex that could produce&lt;/P&gt;&lt;P&gt;7532233,755163&lt;BR /&gt;the id inside the array separated by comma&amp;nbsp;&lt;BR /&gt;since i will be using a sql statement like this&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class="hljs-keyword"&gt;SELECT&lt;/SPAN&gt;  &lt;SPAN class="hljs-operator"&gt;*&lt;/SPAN&gt;
&lt;SPAN class="hljs-keyword"&gt;FROM&lt;/SPAN&gt;    &lt;SPAN class="hljs-keyword"&gt;table&lt;/SPAN&gt;
&lt;SPAN class="hljs-keyword"&gt;WHERE&lt;/SPAN&gt;   id &lt;SPAN class="hljs-operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="hljs-keyword"&gt;ANY&lt;/SPAN&gt;(&lt;SPAN class="hljs-keyword"&gt;ARRAY&lt;/SPAN&gt;[${idArray}])&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;2. even i changed the&amp;nbsp;&lt;SPAN class="table-cell required"&gt;Maximum Buffer Size to 5 MB and&amp;nbsp;&lt;SPAN class="table-cell"&gt;Maximum Capture Group Length to 5000&lt;BR /&gt;i can see that the attribute is being duplicated with name&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV class="attribute-name"&gt;idArray.1&lt;BR /&gt;Is that something i have to worry about ? while calling the attribute ?&lt;/DIV&gt;</description>
      <pubDate>Fri, 10 Jun 2022 20:03:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NIFI-Convert-the-flowfile-content-to-an-attribute/m-p/345423#M234524</guid>
      <dc:creator>IslamGamal</dc:creator>
      <dc:date>2022-06-10T20:03:18Z</dc:date>
    </item>
    <item>
      <title>Re: [ NIFI ] Convert the flowfile content to an attribute</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NIFI-Convert-the-flowfile-content-to-an-attribute/m-p/345424#M234525</link>
      <description>&lt;P&gt;Hi Matt,&lt;BR /&gt;Thanks for alerting me, but since I need to use the extracted id array inside a sql statement and I need to refer to the id array (the only way to do that is to convert the content it to an attribute as far as I know)&lt;BR /&gt;Please if u have an article about how to handle the&amp;nbsp;&lt;SPAN&gt;heap memory let me know&lt;BR /&gt;&lt;/SPAN&gt;because i need to know the cycle and when it's been clean is it after the flowfile finish or something else&lt;BR /&gt;in other scenarios the flowfile will contains a lot of attributes and there is millions of data coming in&lt;BR /&gt;so I appreciate your info&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 20:11:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NIFI-Convert-the-flowfile-content-to-an-attribute/m-p/345424#M234525</guid>
      <dc:creator>IslamGamal</dc:creator>
      <dc:date>2022-06-10T20:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: [ NIFI ] Convert the flowfile content to an attribute</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NIFI-Convert-the-flowfile-content-to-an-attribute/m-p/345427#M234526</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;regarding the first point I dont think you can do that through regex, this is more of transformation operation and you might need to use JsonJolt Processor to do transromation first to simplify the json and store all id's in an array then use regular expression to extract the ids. It will complicate matter it might affect performance. What kind of SQL are you using ? Do you have any json functions in that sql? If that is the case I would recommend you deffer this process to SQL and utilize sql function to parse json.&amp;nbsp; For example in MS SQL you can use OPENJSON function to transpose json into table and then you can use this table in your query.&lt;/P&gt;&lt;P&gt;For the second point, this is because the way the extractText reg expression work it treats like group, so beside the main attribute you will get an indexed attribute for each matched group. You can read more about this here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.5.0/org.apache.nifi.processors.standard.ExtractText/index.html" target="_blank"&gt;https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.5.0/org.apache.nifi.processors.standard.ExtractText/index.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can also use this post to see if you can extract one attirbute. I just found about it:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.cloudera.com/t5/Support-Questions/Extract-whole-json-flowfilecontent-small-to-single-attribute/m-p/308960" target="_blank"&gt;https://community.cloudera.com/t5/Support-Questions/Extract-whole-json-flowfilecontent-small-to-single-attribute/m-p/308960&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 21:46:50 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NIFI-Convert-the-flowfile-content-to-an-attribute/m-p/345427#M234526</guid>
      <dc:creator>SAMSAL</dc:creator>
      <dc:date>2022-06-10T21:46:50Z</dc:date>
    </item>
  </channel>
</rss>

