I have written this following pig script. How can I make this a nested one?
input= LOAD '/path/to/input/data' USING PigStorage('\t') AS (id:chararray,category:chararray);
grp= GROUP input BY category;
grp_count= FOREACH grp generate group, COUNT(input);
grp_ordered= order grp_count by $1 DESC;
top_grp= LIMIT grp_ordered 5;