What is the difference between group and cogroup in Pig Latin ?

Answer:For readability GROUP is used Cogroup used as a statements

Difference between group and cogroup in Pig Latin

Group Cogroup
For readability GROUP is used
in statements involving one relation
Cogroup used as a statements involving two or more relations. Cogroup should no exceed 127 relations at a time.
The group statement collects together
records with the same key
cogroup is a general statement of group. Instead of collecting records of 1 input it collects records of N inputs based on a key
Syntax:
grunt> Group_data = GROUP Relation_name BY age;
Syntax:
alias = CROSS alias, alias [, alias …] [PARTITION BY partitioner] [PARALLEL n];
Leave a Reply

Your email address will not be published. Required fields are marked *

You May Also Like

What is a skewed join in Pig ?

Answer:Joining skewed data using apache Pig skewed join.In a distributed processing environment Data skew is a serious problem,and occurs when the data is not evenly divided among the key tuples from the map phase.
View Answer