Can someone explain with an example how to use GROUP ALL in pig?
Jul 10, 2019 2,930 views

## 1 answer to this question.

Suppose we have a data set as follows:

```001,Rajiv,Reddy,21,9848022337,Hyderabad

002,siddarth,Battacharya,22,9848022338,Kolkata

003,Rajesh,Khanna,22,9848022339,Delhi

004,Preethi,Agarwal,21,9848022330,Pune

005,Trupthi,Mohanthy,23,9848022336,Bhuwaneshwar

006,Archana,Mishra,23,9848022335,Chennai

007,Komal,Nayak,24,9848022334,trivendram

008,Bharathi,Nambiayar,24,9848022333,Chennai```

and we are loading this table as follows:

The record coming out of group all has the chararray literal  'all' as a key and the complete content as the value.That means you would have only one key for all the values which means only one reducer would process the complete file.Because grouping collects all records together with the same value for the key.

Group all is used to group a relation by all the columns as shown below.

`grunt> group_all = GROUP student_details All;`

Now, verify the content of the relation group_all as shown below.

```grunt> Dump group_all;

(all,{(8,Bharathi,Nambiayar,24,9848022333,Chennai),(7,Komal,Nayak,24,9848022334 ,trivendram),

(6,Archana,Mishra,23,9848022335,Chennai),(5,Trupthi,Mohanthy,23,9848022336,Bhuw aneshwar),

(4,Preethi,Agarwal,21,9848022330,Pune),(3,Rajesh,Khanna,22,9848022339,Delhi),

answered Jul 10, 2019 by Roshan

## Use of MapReduce in PIG

Apache Pig programs are written in a ...READ MORE

## Explain the use of FILTER operator in pig?

Hey, The FILTER operator is used to select ...READ MORE

## What is the use of parser in Apache pig?

Hey, It is correct that it comes under ...READ MORE

## What is the use of sequence file in Hadoop?

Sequence files are binary files containing serialized ...READ MORE

+1 vote

## Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

org.apache.hadoop.mapred is the Old API  org.apache.hadoop.mapreduce is the ...READ MORE

## hadoop fs -put command?

Hi, You can create one directory in HDFS ...READ MORE

–1 vote

## Hadoop dfs -ls command?

In your case there is no difference ...READ MORE