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 |
What are the debugging tools used for Apache Pig scripts?
What is a bag in Pig Latin?
What are the different modes available in Pig?
What is the function of UNION and SPLIT operators? Give examples?
What is the use of BloomMapFile?
How does pig work?
Why there is need of pig language?
What is atom in pig?
is it posible to join multiple fields in pig scripts?
How Apache Pig deals with the schema and schema-less data?
What are the different execution modes available in Pig?
How do you run pig scripts on kerberos secured cluster?
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)