<?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: How to get EPOCH time in PIG? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-get-EPOCH-time-in-PIG/m-p/133368#M39551</link>
    <description>&lt;P&gt;That Looks better than what I proposed.  Thumbs up!&lt;/P&gt;</description>
    <pubDate>Sat, 03 Sep 2016 02:50:52 GMT</pubDate>
    <dc:creator>matt_andruff</dc:creator>
    <dc:date>2016-09-03T02:50:52Z</dc:date>
    <item>
      <title>How to get EPOCH time in PIG?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-get-EPOCH-time-in-PIG/m-p/133364#M39547</link>
      <description>&lt;P&gt;I am completely new to pig. Started to learn on my own and trying to know PIG. Can anyone please suggest me to get the &lt;STRONG&gt;current system epoch time using pig&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;I need the output as&lt;/P&gt;&lt;PRE&gt;epochtime_1234567890
&lt;/PRE&gt;&lt;P&gt;And &lt;STRONG&gt;how can we call the shell script in PIG script&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Because I have already written to get EPOCH time in Shell script.&lt;/P&gt;&lt;P&gt;Any Help.&lt;/P&gt;&lt;P&gt;Thanks in Advance.&lt;/P&gt;&lt;P&gt;Mohan.v&lt;/P&gt;</description>
      <pubDate>Fri, 02 Sep 2016 16:14:47 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-get-EPOCH-time-in-PIG/m-p/133364#M39547</guid>
      <dc:creator>mohan221213</dc:creator>
      <dc:date>2016-09-02T16:14:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to get EPOCH time in PIG?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-get-EPOCH-time-in-PIG/m-p/133365#M39548</link>
      <description>&lt;P&gt;Hey Mohan,
&lt;/P&gt;&lt;P&gt;It might be cleaner to just write a UDF.  I certainly feel like PIG has purposely left this functionality out to encourage the use of datetime over the use of epochs.  &lt;/P&gt;&lt;P&gt;
Here's one way to achieve what you want to do:&lt;/P&gt;&lt;PRE&gt;a = load 'test.data';
b = foreach a GENERATE *, CONCAT( 'epochtime_', (chararray)MilliSecondsBetween(CurrentTime(),ToDate(0)))
;dump b;
&lt;/PRE&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Sep 2016 20:58:58 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-get-EPOCH-time-in-PIG/m-p/133365#M39548</guid>
      <dc:creator>matt_andruff</dc:creator>
      <dc:date>2016-09-02T20:58:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to get EPOCH time in PIG?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-get-EPOCH-time-in-PIG/m-p/133366#M39549</link>
      <description>&lt;DIV&gt;Thank for your reply Matt. I think i might got the solution&lt;/DIV&gt;&lt;DIV&gt;b =foreach a GENERATE CONCAT('epochtime_',(chararray) ToUnixTime(CurrentTime(0));&lt;/DIV&gt;&lt;DIV&gt;and i am able to get the output as i want.&lt;/DIV&gt;&lt;DIV&gt;but can you suggest me for,&lt;/DIV&gt;&lt;DIV&gt;reading a words.txt file having words and get the output as&lt;/DIV&gt;&lt;DIV&gt;word1_epochtime word2_epochtime.&lt;/DIV&gt;&lt;DIV&gt;Please don't hesitate to reply.&lt;/DIV&gt;</description>
      <pubDate>Fri, 02 Sep 2016 21:09:46 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-get-EPOCH-time-in-PIG/m-p/133366#M39549</guid>
      <dc:creator>mohan221213</dc:creator>
      <dc:date>2016-09-02T21:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to get EPOCH time in PIG?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-get-EPOCH-time-in-PIG/m-p/133367#M39550</link>
      <description>&lt;P&gt;I think i got it too.&lt;/P&gt;&lt;P&gt;please correct me if im wrong&lt;/P&gt;&lt;P&gt;
&lt;CODE&gt;&lt;/CODE&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;A = LOAD 'words.txt' AS (word:chararray);&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE&gt;B = FOREACH A GENERATE CONCAT(CONCAT(A.word,'_'),(chararray)ToUnixTime(CurrentTime());


dump B;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 02 Sep 2016 21:21:19 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-get-EPOCH-time-in-PIG/m-p/133367#M39550</guid>
      <dc:creator>mohan221213</dc:creator>
      <dc:date>2016-09-02T21:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to get EPOCH time in PIG?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-get-EPOCH-time-in-PIG/m-p/133368#M39551</link>
      <description>&lt;P&gt;That Looks better than what I proposed.  Thumbs up!&lt;/P&gt;</description>
      <pubDate>Sat, 03 Sep 2016 02:50:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-get-EPOCH-time-in-PIG/m-p/133368#M39551</guid>
      <dc:creator>matt_andruff</dc:creator>
      <dc:date>2016-09-03T02:50:52Z</dc:date>
    </item>
  </channel>
</rss>

