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