How can we see only top 15 records from the student.txt out of100 records in the HDFS directory?
Answer / 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 |
Does Pig support multi-line commands?
Can we say a COGROUP is a group of more than 1 data set?
What is the MapReduce plan in pig architecture?
Does Pig differ from MapReduce? If yes, how?
How will you merge the contents of two or more relations and divide a single relation into two or more relations?
What are the different Relational Operators available in pig language?
Explain totuple function?
Define the Use of Pig?
What co-group does in Pig?
What is Apache Pig?
What are the differences between PIG and SQL?
What are the primitive data types in 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)