<?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 [resolved] Extracting earliest load_date's data from Hive tables - ISSUE in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/resolved-Extracting-earliest-load-date-s-data-from-Hive-tables/m-p/2359184#M124056</link>
    <description>Hi All,
&lt;BR /&gt;I need to extract the data from hive table based on the 'earliest' date coming from the data in one of the columns called 'Load_Date' in the same hive table.
&lt;BR /&gt;For ex:- if the Load_Date' has the values like 01jan2016,01feb2016,03mar2016 etc...I need only extract the data for 01jan2016.(i.e. where Load_Date = '01Jan2016' which is the min(Load_Date) from hive table)
&lt;BR /&gt;I tried with couple of options by mentioning in subquery in Hive sql editor in 'tHiveInput' component
&lt;BR /&gt;I am using &amp;nbsp;tHiveConnection and tHiveInput components to extract the data from Hive table and I tried below couple of options and its not working:-
&lt;BR /&gt;1) By using sub query in where cluase in sql editor in Hiveinput component :-
&lt;BR /&gt;
&lt;I&gt;&lt;B&gt;Select coli1,col2,......&lt;/B&gt;&lt;/I&gt;
&lt;B&gt;&lt;I&gt;Load_Date&lt;/I&gt;&lt;/B&gt;
&lt;I&gt;&lt;B&gt;&amp;nbsp;&lt;/B&gt;&lt;/I&gt;
&lt;BR /&gt;
&lt;I&gt;&lt;B&gt;FROM&amp;nbsp;&lt;/B&gt;&lt;/I&gt;
&lt;BR /&gt;
&lt;I&gt;&lt;B&gt;tl.agents_updates&lt;/B&gt;&lt;/I&gt;
&lt;BR /&gt;
&lt;I&gt;&lt;B&gt;where&lt;/B&gt;&lt;/I&gt;
&lt;BR /&gt;
&lt;I&gt;&lt;B&gt;agents_updates&lt;/B&gt;&lt;/I&gt;
&lt;I&gt;&lt;B&gt;.&lt;/B&gt;&lt;/I&gt;
&lt;B&gt;&lt;I&gt;Load_Date&lt;/I&gt;&lt;/B&gt;
&lt;I&gt;&lt;B&gt;&amp;nbsp;= select min(&lt;/B&gt;&lt;/I&gt;
&lt;B&gt;&lt;I&gt;Load_Date&lt;/I&gt;&lt;/B&gt;
&lt;I&gt;&lt;B&gt;) as min_&lt;/B&gt;&lt;/I&gt;
&lt;B&gt;&lt;I&gt;Load_Date&lt;/I&gt;&lt;/B&gt;
&lt;I&gt;&lt;B&gt;&amp;nbsp;from tl.agents_updates&lt;/B&gt;&lt;/I&gt;
&lt;BR /&gt;2) I tried getting min(Load_Date) using aggregator follwed by tHiveInput componet and writing that value in to the context variable (minloaddate) using 'tAggregateRow' and 'tJavaRow' components.
&lt;BR /&gt;and in another flow/subjob tried mentioning where clause in the thiveinput component like&amp;nbsp;
&lt;BR /&gt;
&lt;B&gt;&lt;I&gt;where agents_updates.load_date = '"+context.minloaddate+"'"&lt;/I&gt;&lt;/B&gt;
&lt;BR /&gt;
&lt;B&gt;&lt;I&gt;the context variable in where&amp;nbsp;clause&amp;nbsp;above is not&amp;nbsp;substituting&amp;nbsp;with any value (which is loaded by tjavarow) ,hence getting zero rows!&lt;/I&gt;&lt;/B&gt;
&lt;BR /&gt;
&lt;B&gt;&lt;I&gt;Could you help me on this to resolve the same and any urgent help will be appreciated.&lt;/I&gt;&lt;/B&gt;
&lt;BR /&gt;
&lt;B&gt;&lt;I&gt;Please see the attached screenshot for the job design.&lt;/I&gt;&lt;/B&gt;
&lt;BR /&gt;
&lt;B&gt;&lt;I&gt;Thanks&lt;/I&gt;&lt;/B&gt;</description>
    <pubDate>Sat, 16 Nov 2024 10:32:38 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-11-16T10:32:38Z</dc:date>
    <item>
      <title>[resolved] Extracting earliest load_date's data from Hive tables - ISSUE</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Extracting-earliest-load-date-s-data-from-Hive-tables/m-p/2359184#M124056</link>
      <description>Hi All,
&lt;BR /&gt;I need to extract the data from hive table based on the 'earliest' date coming from the data in one of the columns called 'Load_Date' in the same hive table.
&lt;BR /&gt;For ex:- if the Load_Date' has the values like 01jan2016,01feb2016,03mar2016 etc...I need only extract the data for 01jan2016.(i.e. where Load_Date = '01Jan2016' which is the min(Load_Date) from hive table)
&lt;BR /&gt;I tried with couple of options by mentioning in subquery in Hive sql editor in 'tHiveInput' component
&lt;BR /&gt;I am using &amp;nbsp;tHiveConnection and tHiveInput components to extract the data from Hive table and I tried below couple of options and its not working:-
&lt;BR /&gt;1) By using sub query in where cluase in sql editor in Hiveinput component :-
&lt;BR /&gt;
&lt;I&gt;&lt;B&gt;Select coli1,col2,......&lt;/B&gt;&lt;/I&gt;
&lt;B&gt;&lt;I&gt;Load_Date&lt;/I&gt;&lt;/B&gt;
&lt;I&gt;&lt;B&gt;&amp;nbsp;&lt;/B&gt;&lt;/I&gt;
&lt;BR /&gt;
&lt;I&gt;&lt;B&gt;FROM&amp;nbsp;&lt;/B&gt;&lt;/I&gt;
&lt;BR /&gt;
&lt;I&gt;&lt;B&gt;tl.agents_updates&lt;/B&gt;&lt;/I&gt;
&lt;BR /&gt;
&lt;I&gt;&lt;B&gt;where&lt;/B&gt;&lt;/I&gt;
&lt;BR /&gt;
&lt;I&gt;&lt;B&gt;agents_updates&lt;/B&gt;&lt;/I&gt;
&lt;I&gt;&lt;B&gt;.&lt;/B&gt;&lt;/I&gt;
&lt;B&gt;&lt;I&gt;Load_Date&lt;/I&gt;&lt;/B&gt;
&lt;I&gt;&lt;B&gt;&amp;nbsp;= select min(&lt;/B&gt;&lt;/I&gt;
&lt;B&gt;&lt;I&gt;Load_Date&lt;/I&gt;&lt;/B&gt;
&lt;I&gt;&lt;B&gt;) as min_&lt;/B&gt;&lt;/I&gt;
&lt;B&gt;&lt;I&gt;Load_Date&lt;/I&gt;&lt;/B&gt;
&lt;I&gt;&lt;B&gt;&amp;nbsp;from tl.agents_updates&lt;/B&gt;&lt;/I&gt;
&lt;BR /&gt;2) I tried getting min(Load_Date) using aggregator follwed by tHiveInput componet and writing that value in to the context variable (minloaddate) using 'tAggregateRow' and 'tJavaRow' components.
&lt;BR /&gt;and in another flow/subjob tried mentioning where clause in the thiveinput component like&amp;nbsp;
&lt;BR /&gt;
&lt;B&gt;&lt;I&gt;where agents_updates.load_date = '"+context.minloaddate+"'"&lt;/I&gt;&lt;/B&gt;
&lt;BR /&gt;
&lt;B&gt;&lt;I&gt;the context variable in where&amp;nbsp;clause&amp;nbsp;above is not&amp;nbsp;substituting&amp;nbsp;with any value (which is loaded by tjavarow) ,hence getting zero rows!&lt;/I&gt;&lt;/B&gt;
&lt;BR /&gt;
&lt;B&gt;&lt;I&gt;Could you help me on this to resolve the same and any urgent help will be appreciated.&lt;/I&gt;&lt;/B&gt;
&lt;BR /&gt;
&lt;B&gt;&lt;I&gt;Please see the attached screenshot for the job design.&lt;/I&gt;&lt;/B&gt;
&lt;BR /&gt;
&lt;B&gt;&lt;I&gt;Thanks&lt;/I&gt;&lt;/B&gt;</description>
      <pubDate>Sat, 16 Nov 2024 10:32:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Extracting-earliest-load-date-s-data-from-Hive-tables/m-p/2359184#M124056</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-16T10:32:38Z</dc:date>
    </item>
    <item>
      <title>Re: [resolved] Extracting earliest load_date's data from Hive tables - ISSUE</title>
      <link>https://community.qlik.com/t5/Talend-Studio/resolved-Extracting-earliest-load-date-s-data-from-Hive-tables/m-p/2359185#M124057</link>
      <description>Manage to resolve this issue as the value of min date is not converting (double to string) properly when i pass to the where clause.&lt;BR /&gt;I had to convert double to integer and then integer to string.&lt;BR /&gt;On tjavarow,i did the below and its working fine.&lt;BR /&gt;&lt;BR /&gt;&lt;B&gt;int aloadtime=Integer.valueOf(row2.loadtime.intValue());&lt;/B&gt;&lt;BR /&gt;&lt;B&gt;context.minloadtime=Integer.toString(aloadtime);&lt;/B&gt;&lt;BR /&gt;&lt;B&gt;System.out.println("my context variable value" +context.minloadtime);&lt;/B&gt;</description>
      <pubDate>Thu, 30 Jun 2016 09:41:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/resolved-Extracting-earliest-load-date-s-data-from-Hive-tables/m-p/2359185#M124057</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-06-30T09:41:20Z</dc:date>
    </item>
  </channel>
</rss>

