Introduction to Pig

Last updated on Jun 06,2023 13.2K Views

Introduction to Pig

edureka.co

What is Pig and Pig Latin?

Pig is an open-source high level data flow system. It provides a simple language called Pig Latin, for queries and data manipulation, which are then compiled in to MapReduce jobs that run on Hadoop.

Pig is important as companies like Yahoo, Google and Microsoft are collecting huge amounts of data sets in the form of click streams, search logs and web crawls. Pig is also used in some form of ad-hoc processing and analysis of all the information.

Why Do you Need Pig?

Discover the secrets to harnessing big data for business success in our expert-led Big Data Online Course.

Why was Pig Created?

Pig was originally developed by Yahoo in 2006, for researchers to have an ad-hoc way of creating and executing MapReduce jobs on very large data sets. It was created to reduce the development time through its multi-query approach. Pig is also created for professionals from non-Java background, to make their job easier. You can even check out the details of Big Data with the Data Engineer Course.

Where Should Pig be Used?

Pig can be used under following scenarios:

Where Not to Use Pig?

Applications of Apache Pig:

How Yahoo! Uses Pig:

Yahoo uses Pig for the following purpose:

Use Case of Pig in Healthcare Domain:

The above diagram gives a clear, step by step explanation of how the data flows through Sqoop, HDFS and Pig script.

Comparing MapReduce and Pig using Weather Data:

Source: ftp://ftp.ncdc.noaa.gov/pub/data/uscrn/products/daily01/

Basic Program Structure of Pig:

Source: Pig Wiki

Here’s the hierarchy of Pig’s program structure:

Components of Pig:

What is Pig Latin Program?

Pig Latin program is made up of a series of operations or transformations that are applied to the input data to produce output.  The job of Pig is to convert the transformations in to a series of MapReduce jobs. You can get a better understanding with the Azure Data Engineering Certification in Washington.

Basic Types of Data Models in Pig:

Pig comprises of 4 basic types of data models. They are as follows:

Got a question for us? Mention them in the comments section and we will get back to you.

Related Posts:

Apache Pig UDF – Eval, Aggregate &  Filter Functions

Operators in Apache Pig – Relational Operators

Big Data and Hadoop Training

BROWSE COURSES