<?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: Can NIFI QueryRecord Processor configure FlowFile Query parameters using data retrieved from external sources. in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-NIFI-QueryRecord-Processor-configure-FlowFile-Query/m-p/203054#M78657</link>
    <description>&lt;P&gt;Thank you, Shu for your reply.  I tried the method, but I'm finding an error. I'm not sure how to solve it.&lt;/P&gt;&lt;P&gt;I used QueryDatabaseTable to query a database table column and loaded data to PutDistributedMapCache.  Then fetched cached data using "FetchDistributedMapCache" and then used loaded attribute in QueryRecord. QueryRecord is showing an error.  The error is attached.&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://community.cloudera.com/t5/image/serverpage/image-id/6590i15CEBD858695A564/image-size/large?v=1.0&amp;amp;px=999" border="0" alt="fetch-cache-database-update-flow.png" title="fetch-cache-database-update-flow.png" /&gt;&lt;IMG src="https://community.cloudera.com/t5/image/serverpage/image-id/6591i1C53F419C044EE4F/image-size/large?v=1.0&amp;amp;px=999" border="0" alt="queryrecord-processor-express.png" title="queryrecord-processor-express.png" /&gt;&lt;IMG src="https://community.cloudera.com/t5/image/serverpage/image-id/6593i47600561DD6A2912/image-size/large?v=1.0&amp;amp;px=999" border="0" alt="queryrecord-processor-express-prop.png" title="queryrecord-processor-express-prop.png" /&gt;&lt;IMG src="https://community.cloudera.com/t5/image/serverpage/image-id/6595i7E6A01477030C4D7/image-size/large?v=1.0&amp;amp;px=999" border="0" alt="fetch-distributed-map-cache.png" title="fetch-distributed-map-cache.png" /&gt;&lt;IMG src="https://community.cloudera.com/t5/image/serverpage/image-id/6596i048C1B0B6CD65000/image-size/large?v=1.0&amp;amp;px=999" border="0" alt="put-distributed-map-cache.png" title="put-distributed-map-cache.png" /&gt;</description>
    <pubDate>Sat, 02 Jun 2018 08:54:36 GMT</pubDate>
    <dc:creator>winnie_philip</dc:creator>
    <dc:date>2018-06-02T08:54:36Z</dc:date>
    <item>
      <title>Can NIFI QueryRecord Processor configure FlowFile Query parameters using data retrieved from external sources.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-NIFI-QueryRecord-Processor-configure-FlowFile-Query/m-p/203052#M78655</link>
      <description>&lt;P&gt;I'm creating a NIFI flow to read CSV file data and load it an Relational database.   I used QueryRecord Processor to read CSV/Convert-toJSON/ Filter Flow file data using some parameters.  Everything works perfectly, data loaded to database based on the filter criteria I added to the flow Query.  The flow Query looks like "SELECT * FROM FLOWFILE where VBEOID in (7000,7001,7003)".   In this query, I have added only 3 filter parameters on its "IN" clause.  But in real life situation, there will be 1000's of entries to be added to this filter criteria.  I would like to read these values from a database table or call a REST service to get data, and substitute values in place of hard-coded the value.  Is there a way I can do it? &lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://community.cloudera.com/t5/image/serverpage/image-id/7791i9615F51161FD33C1/image-size/large?v=1.0&amp;amp;px=999" border="0" alt="queryrecord-processor.png" title="queryrecord-processor.png" /&gt;</description>
      <pubDate>Thu, 24 May 2018 02:52:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-NIFI-QueryRecord-Processor-configure-FlowFile-Query/m-p/203052#M78655</guid>
      <dc:creator>winnie_philip</dc:creator>
      <dc:date>2018-05-24T02:52:08Z</dc:date>
    </item>
    <item>
      <title>Re: Can NIFI QueryRecord Processor configure FlowFile Query parameters using data retrieved from external sources.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-NIFI-QueryRecord-Processor-configure-FlowFile-Query/m-p/203053#M78656</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/30153/winniephilip.html" nodeid="30153" target="_blank"&gt;@Winnie Philip&lt;/A&gt;&lt;P&gt;Query Record processor dynamic properties allows expression language, so we can use &lt;STRONG&gt;Distributed Cache&lt;/STRONG&gt; for this case.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Flow1:Load id's into DistributedCache:&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Use &lt;STRONG&gt;PutDistributedMapCache &lt;/STRONG&gt;server and load all your required id's into Cache.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Flow2: Fetch id's from DistributeCache:&lt;/U&gt;&lt;/STRONG&gt;&lt;BR /&gt;In the original flow use &lt;STRONG&gt;FetchDistributedMapCache &lt;/STRONG&gt;processor to fetch the cached data and keep them as attribute, use the same attribute name in your QueryRecord processor.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;QueryRecord&lt;/STRONG&gt; dynamic property query would be&lt;/P&gt;&lt;PRE&gt;SELECT * FROM FLOWFILE where VBEOID in (${fetch_distributed_cache_attribute_name})&lt;/PRE&gt;&lt;P&gt;You may have to change &lt;STRONG&gt;MaxCacheEntrysize &lt;/STRONG&gt;property in PutDistributedMapCache and &lt;STRONG&gt;Max Length To Put In Attribute&lt;/STRONG&gt; property in FetchDistributedMapCache processors as per the size data going to cache and retrieve from cache.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Sample 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="74550-flow.png" style="width: 2476px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/17310iC4DBEEDA4F8A8554/image-size/medium?v=v2&amp;amp;px=400" role="button" title="74550-flow.png" alt="74550-flow.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Refer to &lt;A href="https://community.hortonworks.com/questions/187764/can-executesql-processor-store-state-for-increment.html?childToView=186661#answer-186661" target="_blank" rel="nofollow noopener noreferrer"&gt;this&lt;/A&gt; link for configuring and usage of Put/FetchDistributedCache processors.&lt;/P&gt;&lt;P&gt;By using this method we are not hard coding the values in QueryRecord processor based on the attribute value from the FetchDistributedCache we are running query in QueryRecord processor dynamically.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 05:15:37 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-NIFI-QueryRecord-Processor-configure-FlowFile-Query/m-p/203053#M78656</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2019-08-18T05:15:37Z</dc:date>
    </item>
    <item>
      <title>Re: Can NIFI QueryRecord Processor configure FlowFile Query parameters using data retrieved from external sources.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-NIFI-QueryRecord-Processor-configure-FlowFile-Query/m-p/203054#M78657</link>
      <description>&lt;P&gt;Thank you, Shu for your reply.  I tried the method, but I'm finding an error. I'm not sure how to solve it.&lt;/P&gt;&lt;P&gt;I used QueryDatabaseTable to query a database table column and loaded data to PutDistributedMapCache.  Then fetched cached data using "FetchDistributedMapCache" and then used loaded attribute in QueryRecord. QueryRecord is showing an error.  The error is attached.&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://community.cloudera.com/t5/image/serverpage/image-id/6590i15CEBD858695A564/image-size/large?v=1.0&amp;amp;px=999" border="0" alt="fetch-cache-database-update-flow.png" title="fetch-cache-database-update-flow.png" /&gt;&lt;IMG src="https://community.cloudera.com/t5/image/serverpage/image-id/6591i1C53F419C044EE4F/image-size/large?v=1.0&amp;amp;px=999" border="0" alt="queryrecord-processor-express.png" title="queryrecord-processor-express.png" /&gt;&lt;IMG src="https://community.cloudera.com/t5/image/serverpage/image-id/6593i47600561DD6A2912/image-size/large?v=1.0&amp;amp;px=999" border="0" alt="queryrecord-processor-express-prop.png" title="queryrecord-processor-express-prop.png" /&gt;&lt;IMG src="https://community.cloudera.com/t5/image/serverpage/image-id/6595i7E6A01477030C4D7/image-size/large?v=1.0&amp;amp;px=999" border="0" alt="fetch-distributed-map-cache.png" title="fetch-distributed-map-cache.png" /&gt;&lt;IMG src="https://community.cloudera.com/t5/image/serverpage/image-id/6596i048C1B0B6CD65000/image-size/large?v=1.0&amp;amp;px=999" border="0" alt="put-distributed-map-cache.png" title="put-distributed-map-cache.png" /&gt;</description>
      <pubDate>Sat, 02 Jun 2018 08:54:36 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-NIFI-QueryRecord-Processor-configure-FlowFile-Query/m-p/203054#M78657</guid>
      <dc:creator>winnie_philip</dc:creator>
      <dc:date>2018-06-02T08:54:36Z</dc:date>
    </item>
    <item>
      <title>Re: Can NIFI QueryRecord Processor configure FlowFile Query parameters using data retrieved from external sources.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-NIFI-QueryRecord-Processor-configure-FlowFile-Query/m-p/203055#M78658</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/30153/winniephilip.html" nodeid="30153"&gt;@Winnie Philip&lt;/A&gt;&lt;P&gt;Could you please share the sample csv data and the data that you have loaded using PutDistributedMapCache?&lt;/P&gt;</description>
      <pubDate>Sat, 02 Jun 2018 09:12:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-NIFI-QueryRecord-Processor-configure-FlowFile-Query/m-p/203055#M78658</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2018-06-02T09:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: Can NIFI QueryRecord Processor configure FlowFile Query parameters using data retrieved from external sources.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-NIFI-QueryRecord-Processor-configure-FlowFile-Query/m-p/203056#M78659</link>
      <description>&lt;P&gt;The input csv file used to for loading data to "PutdatabseRecord" is attached.(sample.txt).  I executed a "QueryDatabaseTable" to get data for loading to "PutDistributedMapCache".&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://community.cloudera.com/t5/image/serverpage/image-id/7628i7CE52B661549E64C/image-size/large?v=1.0&amp;amp;px=999" border="0" alt="put-cache.png" title="put-cache.png" /&gt;&lt;IMG src="https://community.cloudera.com/t5/image/serverpage/image-id/7630iCCF0F20E3B8ABB6D/image-size/large?v=1.0&amp;amp;px=999" border="0" alt="querydatabasetable.png" title="querydatabasetable.png" /&gt;</description>
      <pubDate>Sat, 02 Jun 2018 10:14:39 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-NIFI-QueryRecord-Processor-configure-FlowFile-Query/m-p/203056#M78659</guid>
      <dc:creator>winnie_philip</dc:creator>
      <dc:date>2018-06-02T10:14:39Z</dc:date>
    </item>
    <item>
      <title>Re: Can NIFI QueryRecord Processor configure FlowFile Query parameters using data retrieved from external sources.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-NIFI-QueryRecord-Processor-configure-FlowFile-Query/m-p/203057#M78660</link>
      <description>&lt;P&gt;Also, the flow works with "SELECT * FROM FLOWFILE where VBEOID in (7000,7001,7003)"&lt;/P&gt;&lt;P&gt;The flow shows error with "SELECT * FROM FLOWFILE where VBEOID in (${KBA_OID_cache})"&lt;/P&gt;&lt;P&gt;I think I'm doing some incorrect configurations in PutDistributeMapCache and / or FetchDistributedMapCache .&lt;/P&gt;</description>
      <pubDate>Sat, 02 Jun 2018 10:20:33 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-NIFI-QueryRecord-Processor-configure-FlowFile-Query/m-p/203057#M78660</guid>
      <dc:creator>winnie_philip</dc:creator>
      <dc:date>2018-06-02T10:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: Can NIFI QueryRecord Processor configure FlowFile Query parameters using data retrieved from external sources.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-NIFI-QueryRecord-Processor-configure-FlowFile-Query/m-p/203058#M78661</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/30153/winniephilip.html" nodeid="30153"&gt;@Winnie Philip&lt;/A&gt;
&lt;/P&gt;&lt;P&gt;Yep,the issue is with the&lt;STRONG&gt; avro format data&lt;/STRONG&gt; that is going to PutDistributeMapCache processor.&lt;/P&gt;&lt;P&gt;As you have connected &lt;STRONG&gt;QueryDatabaseTable &lt;/STRONG&gt;processor success to PutDistributeMapCache but QDT processor outputs flowfile contents in avro format.&lt;/P&gt;&lt;P&gt;In &lt;STRONG&gt;FetchDistributeCacheMap &lt;/STRONG&gt;processor you are fetching the data into an attribute(avro format data) and using it in QueryRecord processor.&lt;/P&gt;&lt;P&gt;You have to&lt;STRONG&gt; change the format to CSV instead of avro&lt;/STRONG&gt; that is going to PutDistributeCache and the flowfile content needs to be 7000,7001,7003.&lt;/P&gt;&lt;P&gt;Then &lt;STRONG&gt;PutDistributeCache &lt;/STRONG&gt;processor will keep the attribute value as 7000,7001,7003 in csv format when you use QueryRecord processor you are not going to show any issues..!!&lt;/P&gt;</description>
      <pubDate>Sat, 02 Jun 2018 10:30:15 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-NIFI-QueryRecord-Processor-configure-FlowFile-Query/m-p/203058#M78661</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2018-06-02T10:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: Can NIFI QueryRecord Processor configure FlowFile Query parameters using data retrieved from external sources.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-NIFI-QueryRecord-Processor-configure-FlowFile-Query/m-p/203059#M78662</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/30153/winniephilip.html" nodeid="30153"&gt;@Winnie Philip&lt;/A&gt;&lt;P&gt;After QueryDatabaseTable processor use Convert Record processor to read the incoming avro data with &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Schema Access Strategy&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;Use Embedded Avro Schema&lt;/PRE&gt;&lt;P&gt;and Record writer as &lt;STRONG&gt;CsvSetWriter &lt;/STRONG&gt;with the field that you want to keep in DistributedCacheMap processor and&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;**Record Separator** &lt;/STRONG&gt;property value as&lt;/P&gt;&lt;PRE&gt;,&lt;/PRE&gt;&lt;P&gt;Now you are going to have flowfile content in CSV format with the field/s that you want to cache.&lt;/P&gt;&lt;P&gt;Feed the success relationship to &lt;STRONG&gt;PutDistributedMapCache &lt;/STRONG&gt;processor.&lt;/P&gt;&lt;P&gt; &lt;STRONG&gt;Flow:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;1.QueryDatabaseTable&lt;/P&gt;&lt;P&gt;2.ConvertRecord //read incoming avro data and write in Csv format(output needs to be in one line)&lt;/P&gt;&lt;P&gt;3.PutDistributedMapCache&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://community.cloudera.com/t5/image/serverpage/image-id/7889i6B8EC5C0416342E1/image-size/large?v=1.0&amp;amp;px=999" border="0" alt="replacetext.png" title="replacetext.png" /&gt;</description>
      <pubDate>Sat, 02 Jun 2018 11:00:12 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-NIFI-QueryRecord-Processor-configure-FlowFile-Query/m-p/203059#M78662</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2018-06-02T11:00:12Z</dc:date>
    </item>
    <item>
      <title>Re: Can NIFI QueryRecord Processor configure FlowFile Query parameters using data retrieved from external sources.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-NIFI-QueryRecord-Processor-configure-FlowFile-Query/m-p/203060#M78663</link>
      <description>&lt;P&gt;Thanks Shu for your timely reply.  I made it to work!&lt;/P&gt;&lt;P&gt;I used CSVRecordSetWriter property "Record Separator" as ",".  With this change, cache data looked like "7000,7001,7003,".&lt;/P&gt;&lt;P&gt;Then after fetching data from cache, I had to use an expression to remove the trailing "," from filter query. It was giving me an error.&lt;/P&gt;&lt;P&gt;Finally working filter Flow query is:  &lt;/P&gt;&lt;P&gt;SELECT * FROM FLOWFILE where VBEOID in (${KBA_OID_cache:substring(0,${KBA_OID_cache:lastIndexOf(',')})}) &lt;/P&gt;&lt;P&gt;Is there any size limit of how many data I can keep this way in cache?  &lt;/P&gt;</description>
      <pubDate>Tue, 05 Jun 2018 04:03:41 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-NIFI-QueryRecord-Processor-configure-FlowFile-Query/m-p/203060#M78663</guid>
      <dc:creator>winnie_philip</dc:creator>
      <dc:date>2018-06-05T04:03:41Z</dc:date>
    </item>
    <item>
      <title>Re: Can NIFI QueryRecord Processor configure FlowFile Query parameters using data retrieved from external sources.</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-NIFI-QueryRecord-Processor-configure-FlowFile-Query/m-p/203061#M78664</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/30153/winniephilip.html" nodeid="30153"&gt;@Winnie Philip&lt;/A&gt;&lt;P&gt;if you are persisting some small datasets like tens of MB's should be good.If you are trying to cache some big dataset(couple of hundred MB's) then you need to increase the Max cache entry size in PutDistributedCacheMap processor.&lt;/P&gt;&lt;P&gt;In &lt;STRONG&gt;DistributedMapCacheServer &lt;/STRONG&gt;service configure &lt;STRONG&gt;Persistence Directory&lt;/STRONG&gt; property value, If the value specified, the cache will be persisted in the given directory; if not specified, the cache will be in-memory only. By specifying directory we are not going use memory to cache the dataset. &lt;/P&gt;&lt;P&gt;Also you need to increase Maximum Cache Entries property in &lt;B&gt;DistributedMapCacheServer &lt;/B&gt;according to number of cache entries you are trying to keep in cache.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jun 2018 05:12:24 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-NIFI-QueryRecord-Processor-configure-FlowFile-Query/m-p/203061#M78664</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2018-06-05T05:12:24Z</dc:date>
    </item>
  </channel>
</rss>

