Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How to write 'foreach' statement for bag datatype in pig scripts?



How to write 'foreach' statement for bag datatype in pig scripts?..

Answer / Raju Shah

'FOREACH' statement can be used with the bag data type to process each element individually.nSyntax: FOREACH bag_name GENERATED_FOR ALL x GENERATED BY bag_name.x;nInside the 'GENERATED BY' clause, replace 'bag_name.x' with the name of the field inside the bag.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Apache Pig Interview Questions

Explain tokenize?

1 Answers  


What are different modes of execution in Apache Pig?

1 Answers  


What are the Data types in Pig?

1 Answers  


What is Pig Storage?

1 Answers  


Are pig scripts support distributed file systems?

1 Answers  


What do you understand by an inner bag and outer bag in Pig?

1 Answers  


What co-group does in Pig?

1 Answers  


What are the different math functions available in Pig?

1 Answers  


What is the use of foreach operation in Pig scripts?

1 Answers  


Why should we use ‘distinct’ keyword in Pig scripts?

1 Answers  


Define the Use of Pig?

1 Answers  


What is Flatten and what it do in PIG?

1 Answers  


Categories