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
On Fri, Jun 27, 2014 at 4:07 PM, Chhaya Vishwakarma <
Abhishek Agarwal