Introduction to Pig

  • APACHE PIG is one of the major components of Hadoop which is an abstract layer (high level) on the top of MAPREDUCE.
  • Apache pig is meant for processing a huge amount of data that gets stored on top of HDFS.
  • The processing will be carried out in apache pig by making use of different transform actions like load, Generate, filter, etc.
  • So, we can call apache pig as transformation language (or) Data flow language.
  • So the data has to go through this transformation to archive the dizer functionality.

Note: Apache Pig is an abstract layer or high-level language on top of HDFS as every statement of the pig is internally getting converted into MR.

[ Related Page:- Introduction to HDFS (Distributed File System) - Hadoop ]

Map Reduce Vs Apache Pig

1. In MapReduce, for processing data we have to write the driver code, Mapper code, and Reduces code (if required) irrespective of business logic that we are applying Whereas, in Apache pig, we can archive some functionality by making use of scripting language with less number of lines of coding.
2. MapReduce is expecting Java programming language skills whereas in apache pig even a nonjava programming member can write the code using simple scripting.
3. 200 lines of MR code are equal to 10 lines of a pig code.
4. In Map-reduce, we have to follow scripting process something like a compilation of MR code, Executing code, packaging code, and deploy in the cluster whereas, in apache pig, it is very easy to run the code without involving many steps

Interested To Learn Map Reduce Certification Training?  Enroll now for FREE Demo On Map Reduce Training!

 MindMajix YouTube Channel

Installing and Running Pig

  • Pig runs as a client-side application
  • If you want to run pig on a Hadoop cluster, there is nothing extra to install on the cluster i.e. pig launches jobs and interacts with HDFS or other Hadoop file systems from your work station.
  • Installation is straight forward and Java 6 is a prerequisite.
  • Download a stable release from and un place the tar ball in a suitable place on your workstation i.e % tar xzf pig – x.y.z tar.  Gz.
  • It’s convenient to add a pig’s bin directory to your command line path.
  • For Example:  % export PIG-INSTALL=/home/tom/pig-x.y.z export PATH = $ PIG-INSTALL/bin

    You also need to set the JAVA-HOME environment variable to point to a suitable Java Installation.
  • Provide the command pig-help to get usage instructions.
Explore MapReduce Sample Resumes! Download & Edit, Get Noticed by Top Employers!Download Now!

List of Other Big Data Courses:

 Hadoop Adminstartion MapReduce
 Big Data On AWS Informatica Big Data Integration
 Bigdata Greenplum DBA Informatica Big Data Edition
 Hadoop Hive Impala
 Hadoop Testing Apache Mahout


Course Schedule
Hadoop TrainingMay 28 to Jun 12View Details
Hadoop TrainingJun 01 to Jun 16View Details
Hadoop TrainingJun 04 to Jun 19View Details
Hadoop TrainingJun 08 to Jun 23View Details
Last updated: 04 Apr 2023
About Author

Ravindra Savaram is a Technical Lead at His passion lies in writing articles on the most popular IT platforms including Machine learning, DevOps, Data Science, Artificial Intelligence, RPA, Deep Learning, and so on. You can stay up to date on all these technologies by following him on LinkedIn and Twitter.

read less