Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Pig >> mail # user >> Re: Storing time in Pig


Copy link to this message
-
Re: Storing time in Pig
Assuming data is the alias which has start_time and end_time as fields.

data2 = foreach data generate ToDate(Start_time, 'HH:mm:ss') as startDate,
ToDate(End_time, 'HH:mm:ss') as endDate;
data3 = foreach data2 generate SecondsBetween(endDate,startDate) as seconds;

You can find more such functions at
https://github.com/apache/pig/tree/trunk/src/org/apache/pig/builtin
On Fri, Jun 27, 2014 at 4:07 PM, Chhaya Vishwakarma <
[EMAIL PROTECTED]> wrote:
Regards,
Abhishek Agarwal