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?



How can we see only top 15 records from the student.txt out of100 records in the HDFS directory?..

Answer / 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

More Apache Pig Interview Questions

What is pig statistics?

1 Answers  


You have a file employee.txt in the hdfs directory with 100 records. You want to see only the first 10 records from the employee.txt file. How will you do this?

1 Answers  


In which scenario Pig is better fit than MapReduce?

1 Answers  


What are the 2 modes used to run pig scripts?

1 Answers  


What are Pig Execution modes?

1 Answers  


What are different String functions available in PIG?

1 Answers  


What are the relational operators available related to Grouping and joining in Pig language?

1 Answers  


What are the scalar data types in Pig?

1 Answers  


What are the differences between PIG and HIVE?

1 Answers  


What is illustrate used for in apache pig?

1 Answers  


Mention the common features in Pig and Hive?

1 Answers  


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

1 Answers  


Categories