<?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: PIG: CONCAT A relation OUTPUT to another RELATION in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/PIG-CONCAT-A-relation-OUTPUT-to-another-RELATION/m-p/138981#M39908</link>
    <description>&lt;P&gt;I think i got it on my own.&lt;/P&gt;&lt;P&gt;here is the script that i have written.&lt;/P&gt;&lt;PRE&gt;res = FILTER c BY (data::text MATCHES CONCAT(CONCAT('.*',words::word),'.*'));
epoch = FOREACH res GENERATE CONCAT(CONCAT(CONCAT(word,'_'),(chararray)ToUnixTime(CurrentTime(created_at))) as epochtime;
res1= foreach (group epoch by epochtime){data}
dump res1;&lt;/PRE&gt;</description>
    <pubDate>Wed, 07 Sep 2016 14:18:27 GMT</pubDate>
    <dc:creator>mohan221213</dc:creator>
    <dc:date>2016-09-07T14:18:27Z</dc:date>
    <item>
      <title>PIG: CONCAT A relation OUTPUT to another RELATION</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/PIG-CONCAT-A-relation-OUTPUT-to-another-RELATION/m-p/138980#M39907</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;Sorry for the wrong phrasing of question.&lt;/P&gt;&lt;P&gt;I have a scenario where to process the words.t file and data.txt file.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;words.txt&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;word1
word2
word3
word4&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;data.txt&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;{"created_at":"18:47:31,Sun Sep 30 2012","text":"RT @Joey7Barton: ..give a word1 about whether the americans wins a Ryder cup. I mean surely he has slightly more important matters. #fami ...","user_id":450990391,"id":252479809098223616}&lt;/PRE&gt;&lt;P&gt;I need to get the output as &lt;/P&gt;&lt;PRE&gt;(word1_epochtime){complete data which matched in text attribute}

i.e

(word1_1234567890){"created_at":"18:47:31,Sun Sep 30 2012","text":"RT @Joey7Barton: ..give a word1 about whether the americans wins a Ryder cup. I mean surely he has slightly more important matters. #fami ...","user_id":450990391,"id":252479809098223616}&lt;/PRE&gt;&lt;P&gt;I have got the ouput as&lt;/P&gt;&lt;PRE&gt;(word1){"created_at":"18:47:31,Sun Sep 30 2012","text":"RT @Joey7Barton: ..give a word1 about whether the americans wins a Ryder cup. I mean surely he has slightly more important matters. #fami ...","user_id":450990391,"id":252479809098223616}&lt;/PRE&gt;&lt;P&gt;by using this script.&lt;/P&gt;&lt;PRE&gt;1.load words.txt
2.load data.txt
c = cross words,data;
d = FILTER c BY (data::text MATCHES CONCAT(CONCAT('.*',words::word),'.*'));
e =  foreach (group d BY word) {data);&lt;/PRE&gt;&lt;P&gt;and I got the epochtime with the words as&lt;/P&gt;&lt;PRE&gt;&amp;lt;code&amp;gt;time = FOREACH words GENERATE CONCAT(CONCAT(word,'_'),(chararray)ToUnixTime(CurrentTime(created_at)));
&lt;/PRE&gt;
&lt;P&gt;But I am unable to CONCAT the words with time.&lt;/P&gt;&lt;P&gt;How can i get the output as&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(word1_epochtime){data}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;
&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Please feel free to suggest me for the above.&lt;/P&gt;&lt;P&gt;Mohan.V&lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2016 02:09:43 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/PIG-CONCAT-A-relation-OUTPUT-to-another-RELATION/m-p/138980#M39907</guid>
      <dc:creator>mohan221213</dc:creator>
      <dc:date>2016-09-07T02:09:43Z</dc:date>
    </item>
    <item>
      <title>Re: PIG: CONCAT A relation OUTPUT to another RELATION</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/PIG-CONCAT-A-relation-OUTPUT-to-another-RELATION/m-p/138981#M39908</link>
      <description>&lt;P&gt;I think i got it on my own.&lt;/P&gt;&lt;P&gt;here is the script that i have written.&lt;/P&gt;&lt;PRE&gt;res = FILTER c BY (data::text MATCHES CONCAT(CONCAT('.*',words::word),'.*'));
epoch = FOREACH res GENERATE CONCAT(CONCAT(CONCAT(word,'_'),(chararray)ToUnixTime(CurrentTime(created_at))) as epochtime;
res1= foreach (group epoch by epochtime){data}
dump res1;&lt;/PRE&gt;</description>
      <pubDate>Wed, 07 Sep 2016 14:18:27 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/PIG-CONCAT-A-relation-OUTPUT-to-another-RELATION/m-p/138981#M39908</guid>
      <dc:creator>mohan221213</dc:creator>
      <dc:date>2016-09-07T14:18:27Z</dc:date>
    </item>
  </channel>
</rss>

