0% found this document useful (0 votes)
32 views7 pages

Experiment No: 2 Pig Latin Commands Aim

This document discusses an experiment on Pig Latin commands. It provides an overview of Pig Latin and how Pig scripts are processed and executed. It then describes various Pig Latin commands like Load, Dump, Describe, Order By, Group By, Filter, Cross, Join, Limit, and Foreach. Examples are given showing how to use these commands to create tables and databases, perform grouping, joining, filtering, and calculating sums. The conclusion states that the experiment taught how to implement joins, groups, and use various Pig commands to work with data in Hive and Pig.

Uploaded by

kr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views7 pages

Experiment No: 2 Pig Latin Commands Aim

This document discusses an experiment on Pig Latin commands. It provides an overview of Pig Latin and how Pig scripts are processed and executed. It then describes various Pig Latin commands like Load, Dump, Describe, Order By, Group By, Filter, Cross, Join, Limit, and Foreach. Examples are given showing how to use these commands to create tables and databases, perform grouping, joining, filtering, and calculating sums. The conclusion states that the experiment taught how to implement joins, groups, and use various Pig commands to work with data in Hive and Pig.

Uploaded by

kr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

NAME: KRITTIKA ROY SAP: 60002190056 E21 BATCH

Experiment No: 2

PIG LATIN COMMANDS


AIM:
To perform basic PIG LATIN commands.

Theory:

Apache Pig a tool/platform which is used to analyze large datasets and perform long series of data operations.
Pig is used with Hadoop. All pig scripts internally get converted into map-reduce tasks and then get executed. It can
handle structured, semi-structured and unstructured data. Pig stores, its result into HDFS.

All the scripts written in Pig-Latin over grunt shell go to the parser for checking the syntax and other
miscellaneous checks also happens. The output of the parser is a DAG. This DAG then gets passed to
Optimizer, which then performs logical optimization such as projection and pushes down. Then compiler
compiles the logical plan to MapReduce jobs. Finally, these MapReduce jobs are submitted to Hadoop in sorted order.
These jobs get executed and produce the desired results.Pig-Latin data model is fully nested, and it allows
complex data types such as map and tuples.
Any single value of Pig Latin language (irrespective of datatype) is known as Atom .

Commands
Load
Dump
Describe
Order by
Group by
Filter
Cross
Join
Limit
foreach

1
Results:

1. Creating directory and file and moving to pig

2.
2.
2.
2.
2.
2.
2.
2.
2.
2.
2.
2.
2.
2.
2.
2.
2.
2.
Creating tables and dbs:

1
3.

1
1
DESCRIBE COMMAND AND GROUP:

GROUP BY EID:

CROSS PRODUCT:

1
JOIN:

ILLUSTRATE:

GROUP BY SUM:

1
SUM OF SALARY BY EMP ID:

Conclusion:
In this experiment we learnt various pig commands and implementation of joins, groups. We
also learnt how to create a database and table in hive/pig and use commands like
Load,Dump, Describe, Order by, Group by, Filter, Cross, Join, Limit, foreach.

You might also like