<?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 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/44771#M39826</link>
    <description>&lt;P&gt;Sorry for the wrong phrasing of question. I am new to clouderaas well as I am completely new to PIG and trying to experiment on my own.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;words.txt&lt;/P&gt;&lt;PRE&gt;word1
word2
word3
word4&lt;/PRE&gt;&lt;P&gt;data.txt&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;P&gt;&lt;STRONG&gt;(word1_epochtime){complete data which matched in text attribute}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;i.e&lt;/P&gt;&lt;PRE&gt;(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;BLOCKQUOTE&gt;&lt;P&gt;&lt;STRONG&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;/STRONG&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;by using this script.&lt;/P&gt;&lt;PRE&gt;load words.txt
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;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;PRE&gt;(word1_epochtime){data}&lt;/PRE&gt;&lt;P&gt;Please feel free to suggest me for the above.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
    <pubDate>Fri, 16 Sep 2022 10:37:58 GMT</pubDate>
    <dc:creator>MohanBunny</dc:creator>
    <dc:date>2022-09-16T10:37:58Z</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/44771#M39826</link>
      <description>&lt;P&gt;Sorry for the wrong phrasing of question. I am new to clouderaas well as I am completely new to PIG and trying to experiment on my own.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;words.txt&lt;/P&gt;&lt;PRE&gt;word1
word2
word3
word4&lt;/PRE&gt;&lt;P&gt;data.txt&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;P&gt;&lt;STRONG&gt;(word1_epochtime){complete data which matched in text attribute}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;i.e&lt;/P&gt;&lt;PRE&gt;(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;BLOCKQUOTE&gt;&lt;P&gt;&lt;STRONG&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;/STRONG&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;by using this script.&lt;/P&gt;&lt;PRE&gt;load words.txt
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;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;PRE&gt;(word1_epochtime){data}&lt;/PRE&gt;&lt;P&gt;Please feel free to suggest me for the above.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 10:37:58 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/PIG-CONCAT-A-relation-OUTPUT-to-another-RELATION/m-p/44771#M39826</guid>
      <dc:creator>MohanBunny</dc:creator>
      <dc:date>2022-09-16T10:37:58Z</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/44829#M39827</link>
      <description>&lt;DIV class="answer-body"&gt;&lt;P&gt;I think i got it on my own.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here is the script that i have written&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;DIV class="comment-tools hidden"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="control-bar"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Wed, 07 Sep 2016 12:15:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/PIG-CONCAT-A-relation-OUTPUT-to-another-RELATION/m-p/44829#M39827</guid>
      <dc:creator>MohanBunny</dc:creator>
      <dc:date>2016-09-07T12:15:52Z</dc:date>
    </item>
  </channel>
</rss>

