fruits = LOAD '/my/fruit' AS (name:chararray); grouped = GROUP fruits BY name; counts = FOREACH grouped GENERATE group, COUNT(fruits); DUMP counts;
On Fri, May 4, 2012 at 9:06 AM, James Newhaven <[EMAIL PROTECTED]>wrote:
> Say I have a tuple containing the following elements (Apples, Apples, > Oranges, Carrots, Carrots) > > Is it possible in pig to find the counts of the tuple, for example the > output I would like is: > > (Apples, 2) > (Oranges, 1) > (Carrots, 2) > > Thanks, > James >
-- *Note that I'm no longer using my Yahoo! email address. Please email me at [EMAIL PROTECTED] going forward.*
NEW: Monitor These Apps!
All projects made searchable here are trademarks of the Apache Software Foundation.
Service operated by Sematext