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 can we see only top 15 records from the student.txt out of100 records in the HDFS directory?

Answer Posted / Harpal Singh

To view only the top 15 records from a text file (student.txt) in the HDFS directory, you would first need to load the data into Pig, and then use the LIMIT operator to limit the number of rows returned. Here is an example:

A = LOAD 'hdfs://namenode/path/to/student.txt' AS (name:chararray, age:int, grade:float);
B = LIMIT A BY 15;

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the function of UNION and SPLIT operators? Give examples?

578