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?



You have a file employee.txt in the hdfs directory with 100 records. You want to see only the first ..

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

More Apache Pig Interview Questions

How do you run pig scripts on kerberos secured cluster?

1 Answers  


How can you debug a pig script?

1 Answers  


Define Apache Pig?

1 Answers  


How do users interact with HDFS in Apache Pig ?

1 Answers  


Does Pig support multi-line commands?

1 Answers  


Why we use BloomMapFile?

1 Answers  


Can we say a COGROUP is a group of more than 1 data set?

1 Answers  


Explain different execution modes available in Pig?

1 Answers  


What are the basic steps to writing a UDF Function in Pig?

1 Answers  


How do users interact with the shell in apache pig?

1 Answers  


How to show up details in pig ?

1 Answers  


Why Do We Need Apache Pig?

1 Answers  


Categories