<?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: QueryDatabaseTable Problem in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/QueryDatabaseTable-Problem/m-p/380811#M244173</link>
    <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/108303"&gt;@FrankHaha&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I need to understand the following:&lt;/P&gt;&lt;P&gt;1- Does the table have total of 500 records and if so are those records static or are they going to be modified over time and you need to keep processing them ?&lt;/P&gt;&lt;P&gt;2- Do you need to run the ExecuteSQL multiple times to process the same\updated 500 records or do you just need to process them once ? each run of ExecuteSQL with the provided select query will fetch the total records, so if you start the processor to start running indefinitly where the Run Schedule under the Scheduling tab is set to 0 then it will keep fetching the same total records again and again and it will fill up the queue .&lt;/P&gt;</description>
    <pubDate>Thu, 14 Dec 2023 14:45:37 GMT</pubDate>
    <dc:creator>SAMSAL</dc:creator>
    <dc:date>2023-12-14T14:45:37Z</dc:date>
    <item>
      <title>QueryDatabaseTable Problem</title>
      <link>https://community.cloudera.com/t5/Support-Questions/QueryDatabaseTable-Problem/m-p/380723#M244141</link>
      <description>&lt;P&gt;Hi, Guys. I am new to use NiFi flow. I am kind of confused about Query database table processor. So now, I am try to get all data from Postgres database and convert them into json and then convert them into xml.&lt;/P&gt;&lt;P&gt;But sometimes, the Query database table processor will have a lot of Flow file and then the queue just mess up. I try to set the art_id to be maximum-value column but it doesn't work well because art_id is string.(not sure)&lt;/P&gt;&lt;P&gt;This is a screenshot from a sample table called title and it has about 500 rows. How to query them just one time and split them into 500 flowfile and each of flowfile has only one row from table title without any duplicates. Can someone help me?&lt;/P&gt;&lt;P&gt;Thank you so much. Following screenshots are my progress so far.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-12-12 at 2.27.23 PM.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/39170i381CCDD3C9E84D5A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2023-12-12 at 2.27.23 PM.png" alt="Screenshot 2023-12-12 at 2.27.23 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-12-12 at 2.27.40 PM.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/39171i0D06ED85284F7724/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2023-12-12 at 2.27.40 PM.png" alt="Screenshot 2023-12-12 at 2.27.40 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-12-12 at 2.27.55 PM.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/39172iD932C8435266CCE2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2023-12-12 at 2.27.55 PM.png" alt="Screenshot 2023-12-12 at 2.27.55 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-12-12 at 2.28.09 PM.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/39173i1FA663E257F28E06/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2023-12-12 at 2.28.09 PM.png" alt="Screenshot 2023-12-12 at 2.28.09 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-12-12 at 2.25.10 PM.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/39169i0E4AC5E502C60F3A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2023-12-12 at 2.25.10 PM.png" alt="Screenshot 2023-12-12 at 2.25.10 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2023 19:37:45 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/QueryDatabaseTable-Problem/m-p/380723#M244141</guid>
      <dc:creator>FrankHaha</dc:creator>
      <dc:date>2023-12-12T19:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: QueryDatabaseTable Problem</title>
      <link>https://community.cloudera.com/t5/Support-Questions/QueryDatabaseTable-Problem/m-p/380730#M244143</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/108303"&gt;@FrankHaha&lt;/a&gt;&amp;nbsp;Welcome to the Cloudera Community!&lt;BR /&gt;&lt;BR /&gt;To help you get the best possible solution, I have tagged our NiFi experts&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/80381"&gt;@SAMSAL&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/103151"&gt;@cotopaul&lt;/a&gt;&amp;nbsp;&amp;nbsp;who may be able to assist you further.&lt;BR /&gt;&lt;BR /&gt;Please keep us updated on your post, and we hope you find a satisfactory solution to your query.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Dec 2023 20:36:48 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/QueryDatabaseTable-Problem/m-p/380730#M244143</guid>
      <dc:creator>DianaTorres</dc:creator>
      <dc:date>2023-12-12T20:36:48Z</dc:date>
    </item>
    <item>
      <title>Re: QueryDatabaseTable Problem</title>
      <link>https://community.cloudera.com/t5/Support-Questions/QueryDatabaseTable-Problem/m-p/380740#M244147</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/108303"&gt;@FrankHaha&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;The &lt;SPAN class="lia-message-read"&gt;QueryDatabaseTable processor is used mainly when you are having a dynamic data table where the data is continuously being added\updated. The provided Maximum Value Column will always help tack the delta by saving the last max value retrieved from the last generated query and so on. This Max value column works better for columns where values increase over time for example numerical , datetime values. For string values it can work if that added\changed is always guaranteed to be greater than previous max value otherwise you might get unpredictable results. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-message-read"&gt;In your case, when you say that the "queue will have a lot of flowfile and it will mess up" can you explain that more? for example are you getting more flowfiles than whats in the table, getting duplicates&amp;nbsp; or getting error? what exactly happen?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-message-read"&gt;If you have fixed number of records that is not going to change in the future as you are indicating there is 500 records and you want to process the data onetime , then you dont need to use QueryDatabaseTable&amp;nbsp; with max value column, you can use ExecuteSQL or ExecuteSQLRecord and specify the select statement in the "SQL Select Query" property , In the ExecuteSQL you will get the result in Avro format but if you use the ExecuteSQLRecord you can decide the output format&amp;nbsp; in the RecordWriter , for example if you are looking to convert data into Json or XML right away without having to go through Avro.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-message-read"&gt;If that helps please &lt;STRONG&gt;accept&lt;/STRONG&gt; solution.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="lia-message-read"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2023 02:15:43 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/QueryDatabaseTable-Problem/m-p/380740#M244147</guid>
      <dc:creator>SAMSAL</dc:creator>
      <dc:date>2023-12-13T02:15:43Z</dc:date>
    </item>
    <item>
      <title>Re: QueryDatabaseTable Problem</title>
      <link>https://community.cloudera.com/t5/Support-Questions/QueryDatabaseTable-Problem/m-p/380788#M244163</link>
      <description>&lt;P&gt;Thank you for your reply.&lt;/P&gt;&lt;P&gt;Yes,&amp;nbsp;&lt;SPAN&gt;"queue will have a lot of flowfile and it will mess up"&amp;nbsp; means that there are a lot of data that I don't really want. I just want the 500 row in my table.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;My flow so far is&amp;nbsp;ExecuteSQL and then split avro and then convert to json and then convert to xml. I want each flow file have one row in my table.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For the executeSQL, do I need to set up schedule&amp;nbsp;time? If I run executeSQL, will I get exactly 500 flowfile?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2023 18:14:44 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/QueryDatabaseTable-Problem/m-p/380788#M244163</guid>
      <dc:creator>FrankHaha</dc:creator>
      <dc:date>2023-12-13T18:14:44Z</dc:date>
    </item>
    <item>
      <title>Re: QueryDatabaseTable Problem</title>
      <link>https://community.cloudera.com/t5/Support-Questions/QueryDatabaseTable-Problem/m-p/380790#M244164</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/108303"&gt;@FrankHaha&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Is there only 500 records in your table and that is all the records you want to processes? If so then you dont need to create schedule , you can run it once using the query&amp;nbsp; in the "SQL Select Query" property:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;select * from public.art_title&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you use the ExecuteSQLRecord then you can set the RecordWriter to Json using JsonRecordSetWriter, or XML using XMLRecordSetWriter to get the needed format, this way you save yourself having to convert from Avro to Json then Json to XML. You can get the result in XML right way.&lt;/P&gt;&lt;P&gt;Also if you set the property "Max Rows Per FlowFile" to 1 , then it will create only one record per flowfile so there is no need to split.&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2023 18:53:51 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/QueryDatabaseTable-Problem/m-p/380790#M244164</guid>
      <dc:creator>SAMSAL</dc:creator>
      <dc:date>2023-12-13T18:53:51Z</dc:date>
    </item>
    <item>
      <title>Re: QueryDatabaseTable Problem</title>
      <link>https://community.cloudera.com/t5/Support-Questions/QueryDatabaseTable-Problem/m-p/380808#M244171</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-12-14 at 9.15.57 AM.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/39187iBEF0B31826E7A18E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2023-12-14 at 9.15.57 AM.png" alt="Screenshot 2023-12-14 at 9.15.57 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but it looks like still a lot of information, not only 500 flowfiles in the queue. Above pic is my configuration.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-12-14 at 9.17.29 AM.png" style="width: 685px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/39188i3385F81094A1A409/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2023-12-14 at 9.17.29 AM.png" alt="Screenshot 2023-12-14 at 9.17.29 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2023 14:17:45 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/QueryDatabaseTable-Problem/m-p/380808#M244171</guid>
      <dc:creator>FrankHaha</dc:creator>
      <dc:date>2023-12-14T14:17:45Z</dc:date>
    </item>
    <item>
      <title>Re: QueryDatabaseTable Problem</title>
      <link>https://community.cloudera.com/t5/Support-Questions/QueryDatabaseTable-Problem/m-p/380810#M244172</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2023-12-14 at 9.22.04 AM.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/39189i6640B0FF12848C78/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2023-12-14 at 9.22.04 AM.png" alt="Screenshot 2023-12-14 at 9.22.04 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;By the way , on the upper&amp;nbsp;right corner of NiFi page, there are some errors that I can't understand. Can you explain it to me? Thank you so much!!!&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2023 14:23:07 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/QueryDatabaseTable-Problem/m-p/380810#M244172</guid>
      <dc:creator>FrankHaha</dc:creator>
      <dc:date>2023-12-14T14:23:07Z</dc:date>
    </item>
    <item>
      <title>Re: QueryDatabaseTable Problem</title>
      <link>https://community.cloudera.com/t5/Support-Questions/QueryDatabaseTable-Problem/m-p/380811#M244173</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/108303"&gt;@FrankHaha&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I need to understand the following:&lt;/P&gt;&lt;P&gt;1- Does the table have total of 500 records and if so are those records static or are they going to be modified over time and you need to keep processing them ?&lt;/P&gt;&lt;P&gt;2- Do you need to run the ExecuteSQL multiple times to process the same\updated 500 records or do you just need to process them once ? each run of ExecuteSQL with the provided select query will fetch the total records, so if you start the processor to start running indefinitly where the Run Schedule under the Scheduling tab is set to 0 then it will keep fetching the same total records again and again and it will fill up the queue .&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2023 14:45:37 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/QueryDatabaseTable-Problem/m-p/380811#M244173</guid>
      <dc:creator>SAMSAL</dc:creator>
      <dc:date>2023-12-14T14:45:37Z</dc:date>
    </item>
    <item>
      <title>Re: QueryDatabaseTable Problem</title>
      <link>https://community.cloudera.com/t5/Support-Questions/QueryDatabaseTable-Problem/m-p/380812#M244174</link>
      <description>&lt;P&gt;1. These data is static and there are only 500 rows in the table. I don't need to modify them in the future and I don't need to keep processing them. I only need to get all 500 rows from table and then done.&lt;/P&gt;&lt;P&gt;2. I just need to process them once. Do I need to set the schedule time longer so that the&amp;nbsp;&lt;SPAN&gt;ExecuteSQL only process once and this once will contain 500 rows?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2023 14:49:11 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/QueryDatabaseTable-Problem/m-p/380812#M244174</guid>
      <dc:creator>FrankHaha</dc:creator>
      <dc:date>2023-12-14T14:49:11Z</dc:date>
    </item>
    <item>
      <title>Re: QueryDatabaseTable Problem</title>
      <link>https://community.cloudera.com/t5/Support-Questions/QueryDatabaseTable-Problem/m-p/380814#M244176</link>
      <description>&lt;P&gt;Another things is that if I found some record contain data that doesn't exist in my table(art_title). I don't know why. I can confirm my art_title table only contain 500 rows for sure.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2023 14:52:54 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/QueryDatabaseTable-Problem/m-p/380814#M244176</guid>
      <dc:creator>FrankHaha</dc:creator>
      <dc:date>2023-12-14T14:52:54Z</dc:date>
    </item>
    <item>
      <title>Re: QueryDatabaseTable Problem</title>
      <link>https://community.cloudera.com/t5/Support-Questions/QueryDatabaseTable-Problem/m-p/380815#M244177</link>
      <description>&lt;P&gt;It seems that you need to process the 500 records once. In this case you dont need to start the ExecuteSQL processor nor worry about scheduling it unless you want to run it again in the future. Keep the processor stopped then&amp;nbsp; right click on it and select Run Once. This should load the total number of records one time.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Dec 2023 15:03:04 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/QueryDatabaseTable-Problem/m-p/380815#M244177</guid>
      <dc:creator>SAMSAL</dc:creator>
      <dc:date>2023-12-14T15:03:04Z</dc:date>
    </item>
  </channel>
</rss>

