Apache Pig Tutorial on Apache Pig Illustrate Operator

the illustrate operator gives you the step-by-step execution of a sequence of statements.

syntax

given below is the syntax of the illustrate operator.

grunt> illustrate relation_name;

example

assume we have a file student_data.txt in hdfs with the following content.

001,rajiv,reddy,9848022337,hyderabad
002,siddarth,battacharya,9848022338,kolkata 
003,rajesh,khanna,9848022339,delhi
004,preethi,agarwal,9848022330,pune 
005,trupthi,mohanthy,9848022336,bhuwaneshwar
006,archana,mishra,9848022335,chennai.

and we have read it into a relation student using the load operator as shown below.

grunt> student = load 'hdfs://localhost:9000/pig_data/student_data.txt' using pigstorage(',')
   as ( id:int, firstname:chararray, lastname:chararray, phone:chararray, city:chararray );

now, let us illustrate the relation named student as shown below.

grunt> illustrate student;

output

on executing the above statement, you will get the following output.

grunt> illustrate student;

info  org.apache.pig.backend.hadoop.executionengine.mapreducelayer.pigmaponly$m ap - aliases
being processed per job phase (aliasname[line,offset]): m: student[1,10] c:  r:
---------------------------------------------------------------------------------------------
|student | id:int | firstname:chararray | lastname:chararray | phone:chararray | city:chararray |
--------------------------------------------------------------------------------------------- 
|        | 002    | siddarth            | battacharya        | 9848022338      | kolkata        |
---------------------------------------------------------------------------------------------