Pig Mode in Big Data Hadoop
•All the files are installed and run from local host and local file system.
•There is no need of Hadoop or HDFS. This mode is generally used for testing purpose.
•$ ./pig –x local
•MapReduce mode is where we load or process the data that exists in the Hadoop File System (HDFS) using Apache Pig. In this mode, whenever we execute the Pig Latin statements to process the data, a MapReduce job is invoked in the back-end to perform a particular operation on the data that exists in the HDFS.
•$ ./pig -x mapreduce or simply pig
Can be write an entire Pig Latin script in a file and execute it using the –x command. Let us have a Pig script in a file named sample_script.pig.
student = LOAD 'hdfs://localhost:9000/input/student.txt' USING PigStorage(',') as (id:int,name:chararray,city:chararray);
student = LOAD 'hdfs:/input/student.txt' USING PigStorage(',') as (id:int,name:chararray,city:chararray);
Post Your Comment