Professional Documents
Culture Documents
Pig
Pig
Pig
1
Definition:
The Pig scripts get internally converted to Map Reduce jobs and get
executed on data stored in HDFS.
Every task which can be achieved using PIG can also be achieved
using java used in MapReduce.
Architecture:
Pig Architecture contains the Pig Latin Interpreter and
will be used on the Client Machine.
Compiler:
The compiler compiles the optimized logical plan
into a series of MapReduce jobs.
Optimizer:
The output of parser passed to optimizer for
optimization.
Features of PIG:
It has less line of code as compared to map It has more lines of code.
reduce
It is high level data processing tool It is low level data processing tool
PIG HIVE
It uses pig-latin language, used for It uses HQL (Hive Query Language), used
programming for reporting.
It does not supports JDBC and ODBC It supports JDBC and ODBC
PIG Utility commands:
Grunt is PIG’s interactive shell. It enable us to enter PIG Latin
interactively and provides a shell for user to interact with HDFS.
Shell Commands
It used to execute fs shell command from grunt shell or PIG script.
Example:
grunt> fs –ls
Utility Commands:
grunt>clear
grunt>help
grunt>run myscript.pig
grunt>quit
PIG Utility commands: