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 / 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 |
How do you run pig scripts on kerberos secured cluster?
How can you debug a pig script?
Define Apache Pig?
How do users interact with HDFS in Apache Pig ?
Does Pig support multi-line commands?
Why we use BloomMapFile?
Can we say a COGROUP is a group of more than 1 data set?
Explain different execution modes available in Pig?
What are the basic steps to writing a UDF Function in Pig?
How do users interact with the shell in apache pig?
How to show up details in pig ?
Why Do We Need Apache Pig?
Apache Hadoop (394)
MapReduce (354)
Apache Hive (345)
Apache Pig (225)
Apache Spark (991)
Apache HBase (164)
Apache Flume (95)
Apache Impala (72)
Apache Cassandra (392)
Apache Mahout (35)
Apache Sqoop (82)
Apache ZooKeeper (65)
Apache Ambari (93)
Apache HCatalog (34)
Apache HDFS Hadoop Distributed File System (214)
Apache Kafka (189)
Apache Avro (26)
Apache Presto (15)
Apache Tajo (26)
Hadoop General (407)