Pig Group and Co-Group
Pig Group and Co-Group
Use cogroup on the two relations order and order_details created by orderDate and
ItemId
grunt> order = LOAD 'hdfs://localhost:9000/pig_data/order.txt' USING
PigStorage(',')
as (id:int, firstname:chararray, lastname:chararray, age:int, phone:chararray,
city:chararray);
grunt> order_details = LOAD 'hdfs://localhost:9000/pig_data/order_details.txt'
USING PigStorage(',')
as (id:int, name:chararray, age:int, city:chararray);
grunt> cogroup_data = COGROUP order by orderDate, order_details by itemid;