iamthechad
3/7/2017 - 6:26 PM

author_result_group.pig

author_result = FOREACH (GROUP with_count BY BookAuthor) { 
>> order_by_count = ORDER with_count BY count DESC; 
>> GENERATE group AS Author, order_by_count.(Year, count) AS Books; 
>> }; 

DESCRIBE author_result; 

author_result: {Author: chararray,Books: {(group::Year: int,count: long)}}