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

Switch to Threaded View
Pig, mail # user - SUM of project-range of fields?


Copy link to this message
-
Re: SUM of project-range of fields?
Russell Jurney 2013-03-11, 04:15
Try:

movie_and_genres = FOREACH movies GENERATE $0,
(b:bag{t:tuple(i:int)})TOBAG($2 ..) AS genres:b:bag{t:tuple(i:int)};
foo = foreach movies_and_genres generate SUM(genres) as genre_total;
Russell Jurney http://datasyndrome.com

On Mar 10, 2013, at 7:45 AM, Nathan Neff <[EMAIL PROTECTED]> wrote:

> movie_and_genres = FOREACH movies GENERATE $0, TOBAG($2 ..) AS genres;