<?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>topic Re: Retrieve row count from a Amazon Redshift Spectrum table in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Retrieve-row-count-from-a-Amazon-Redshift-Spectrum-table/m-p/2356385#M121923</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt; 
&lt;P&gt;Normally, Nb_LINE&amp;nbsp; is used to count the total number of records have been proceed. When this option is set to NONE, there is no a global variable for counting the total number of records have been inserted, updated, or deleted.&lt;/P&gt; 
&lt;P&gt;When inserted item is choosen, there will be a global variale such as ((Integer)globalMap.get("tRedshiftOutput_1_NB_LINE_INSERTED")) will be available, which counts the total number of records have been inserted into database. The same to updated, deleted items.&lt;/P&gt; 
&lt;P&gt;Best regards&lt;/P&gt; 
&lt;P&gt;Sabrina&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 13 Apr 2018 07:58:33 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2018-04-13T07:58:33Z</dc:date>
    <item>
      <title>Retrieve row count from a Amazon Redshift Spectrum table</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Retrieve-row-count-from-a-Amazon-Redshift-Spectrum-table/m-p/2356384#M121922</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a requirement wherein i need to iterate a list of table names from SQl DB and then fire a query on each of these tables to retrieve the count of records in each.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have made the below design&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;tMSSQLInput--&amp;gt;tRedshiftRow--&amp;gt;tLogRow&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The challenge I am facing is that, as per documentation, tRedshiftRow does not return any output. Hence, I tried using tJdbcRow to achieve this and still no luck. The counts always come back blank (not zero but blank).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone please suggest a way to achieve this?&lt;/P&gt;</description>
      <pubDate>Mon, 09 Apr 2018 14:59:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Retrieve-row-count-from-a-Amazon-Redshift-Spectrum-table/m-p/2356384#M121922</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-04-09T14:59:35Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve row count from a Amazon Redshift Spectrum table</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Retrieve-row-count-from-a-Amazon-Redshift-Spectrum-table/m-p/2356385#M121923</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt; 
&lt;P&gt;Normally, Nb_LINE&amp;nbsp; is used to count the total number of records have been proceed. When this option is set to NONE, there is no a global variable for counting the total number of records have been inserted, updated, or deleted.&lt;/P&gt; 
&lt;P&gt;When inserted item is choosen, there will be a global variale such as ((Integer)globalMap.get("tRedshiftOutput_1_NB_LINE_INSERTED")) will be available, which counts the total number of records have been inserted into database. The same to updated, deleted items.&lt;/P&gt; 
&lt;P&gt;Best regards&lt;/P&gt; 
&lt;P&gt;Sabrina&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Apr 2018 07:58:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Retrieve-row-count-from-a-Amazon-Redshift-Spectrum-table/m-p/2356385#M121923</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-04-13T07:58:33Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve row count from a Amazon Redshift Spectrum table</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Retrieve-row-count-from-a-Amazon-Redshift-Spectrum-table/m-p/2356386#M121924</link>
      <description>&lt;P&gt;Thanks Sabrina for the response. But, my requirement is not to perform any DML on the table. The target table whose record count I require is a spectrum table and hence table cannot be modified.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me try to explain with a scenario. Lets say, I have 3 tables in Redshift Spectrum namely, TableA, TableB and TableC. Now I have the names of these tables available with me and I want to find the count of records in each of these tables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, I will iterate the list of table names and then fire SQL query on each.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;select count(*) from TableA

select count(*) from TableB

select count(*) from TableC&lt;/PRE&gt;
&lt;P&gt;and so on.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to achieve this in a generic manner so that irrespective of how many table names I have, i can execute the same piece of code in a loop to retrieve the counts and provide in the output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please let me know if you require further details.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Apr 2018 11:22:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Retrieve-row-count-from-a-Amazon-Redshift-Spectrum-table/m-p/2356386#M121924</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-04-13T11:22:45Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve row count from a Amazon Redshift Spectrum table</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Retrieve-row-count-from-a-Amazon-Redshift-Spectrum-table/m-p/2356387#M121925</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Are you looking for approach, where you would like to send table name as input and get record count in that table and load in table?&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Please try the below, here i used oracle. You can use other data base as well.&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="TableRecordCnt.PNG" style="width: 712px;"&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="0683p000009LwOI.png"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/154574i8E595E9ACEC2D509/image-size/large?v=v2&amp;amp;px=999" role="button" title="0683p000009LwOI.png" alt="0683p000009LwOI.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Step1: Create context variable tableName and assign in put table name to context by using tJavarow.&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Step2: Using tMap join tDB input to input as cross join. Select load lookup for each row.&lt;/P&gt; 
&lt;P&gt;Step3: Use override Query in DB input and&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;"select COUNT(*) REC_CNT from "+context.tableName&lt;/P&gt; 
&lt;P&gt;&amp;nbsp;&lt;/P&gt; 
&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Fri, 13 Apr 2018 20:23:37 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Retrieve-row-count-from-a-Amazon-Redshift-Spectrum-table/m-p/2356387#M121925</guid>
      <dc:creator>vboppudi</dc:creator>
      <dc:date>2018-04-13T20:23:37Z</dc:date>
    </item>
    <item>
      <title>Re: Retrieve row count from a Amazon Redshift Spectrum table</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Retrieve-row-count-from-a-Amazon-Redshift-Spectrum-table/m-p/2356388#M121926</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;SPAN&gt;Veeranjaneyulu. That was an awesome solution.&amp;nbsp;&lt;STRONG&gt;"Select load lookup for each row."&amp;nbsp;&lt;/STRONG&gt;was exactly what did the trick. Never thought of using it this way. Kudos.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 14 Apr 2018 18:52:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Retrieve-row-count-from-a-Amazon-Redshift-Spectrum-table/m-p/2356388#M121926</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-04-14T18:52:48Z</dc:date>
    </item>
  </channel>
</rss>

