Apache Pig diagnostic operators
1) A machine with Ubuntu 14.04 LTS operating system
2) Apache Hadoop 2.6.4 pre installed (How to install Hadoop on Ubuntu 14.04)
3) Apache Pig pre installed (How to install Pig on Ubuntu 14.04)
Pig Diagnostic Operators
The load statement will simply load the data into the specified relation in Apache Pig. To verify the execution of the Load statement, you have to use the Diagnostic Operators. Pig Latin provides four different types of diagnostic operators:
1) Dump operator
2) Describe operator
3) Explain operator
4) Illustrate operator
Step 1 - Change the directory to /usr/local/pig/bin
Step 2 - Enter into grunt shell in MapReduce mode.
Step 3 - Make a pig directory in HDFS. Make sure hadoop daemons are running.
Step 4 - Create a student_data.txt file.
Step 5 - Add the following lines to student_data.txt file. Save and close.
Step 6 - Copy student_data.txt file from local file system to HDFS. In my case, the student_data.txt file is stored in /home/hduser/Desktop/PIG/ directory.
Step 7 - Verify the copy by using cat command.
Step 8 - Load data.
Dump Operator - The Dump operator is used to run the Pig Latin statements and display the results on the screen. It is generally used for debugging Purpose.
Describe Operator - The describe operator is used to view the schema of a relation.
Explain Operator - The explain operator is used to display the logical, physical, and MapReduce execution plans of a relation.
Illustrator Operator - The illustrate operator gives you the step-by-step execution of a sequence of statements.
Please share this blog post and follow me for latest updates on
Labels : Pig Installation Pig Execution Mechanism Pig GRUNT Shell Usage Pig Load and Store Operations Pig Group Example Pig Join Example Pig Cross Example Pig Union Example Pig Split Example Pig Filter Example Pig Distinct Example Pig Foreach Example Pig OrderBy Example Limit Example Pig Eval Functions Example Pig BagToString Example Pig Concat Example Pig Tokenize Example Pig UDF's Java Example Pig SCRIPT