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?
Answer Posted / Akshaya Kumar Singh
In Apache Pig, to view the first 10 records of a file, you can use the HEAD operator.nn`data = LOAD 'hdfs://path/to/employee.txt' AS (col1: chararray, col2: int, col3: float);ndata_head = HEAD data 10;nDUMP data_head;`
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers