Home >> Big Data Hadoop >> Pig Mode in Big Data Hadoop

Pig Mode in Big Data Hadoop

Local Mode:

•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

HDFS mode:

•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

Batch Mode:

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);
                                        OR
student = LOAD 'hdfs:/input/student.txt' USING PigStorage(',') as (id:int,name:chararray,city:chararray);
 

Post Your Comment

Next Questions
Pig Load data from HDFS
Pig Store data into HDFS
Pig Load and Store
Pig Features
Pig Vs MapReduce
Pig Vs Hive
Data Model(Data Types)
Pig Tuple
Pig Bag
Pig Map
Pig Data types
Pig Complex types
Pig Relational Operations
Pig Shell Commands
Pig Register jar
Pig Diagnostic Operators
Pig Group Operator
Pig Join Operator
Pig Group Operators
Pig Cogroup Operator
Pig Built-in functions(EVAL)
Pig Built-in functions
Pig Load &Store Function
Sqoop Prerequisites
Sqoop Installation

Copyright ©2022 coderraj.com. All Rights Reserved.