Google News
logo
Hadoop - Interview Questions
State the usage of the group, order by, and distinct keywords in Pig scripts.
The Group statement collects various records with the same key and groups the data in one or more relations.
 
Example : Group_data = GROUP Relation_name BY AGE
 

The Order statement is used to display the contents of relation in sorted order based on one or more fields.
 
Example : Relation_2 = ORDER Relation_name1 BY (ASC|DSC)
 

Distinct statement removes duplicate records and is implemented only on entire records, and not on individual records.
 
Example : Relation_2 = DISTINCT Relation_name1

Advertisement