You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pig.apache.org by Apache Wiki <wi...@apache.org> on 2008/07/01 21:49:32 UTC

[Pig Wiki] Update of "Grunt" by OlgaN

Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Pig Wiki" for change notification.

The following page has been changed by OlgaN:
http://wiki.apache.org/pig/Grunt

------------------------------------------------------------------------------
  ==== dump ====
  Allows to dump content of `pig` alias to the screen. Useful for debugging. Described in PigLatin
  [[Anchor(help)]]
+ 
+ [[Anchor(explain)]]
+ ==== explain ====
+ 
+ This command allows to review the execution plan to compute the specified relationship.
+ 
+ {{{
+ grunt> A = load '/user/pig/tests/data/singlefile/studenttab10k' using PigStorage('\t') as (name, age, gpa);
+ grunt> B = group A by name;
+ grunt> C = foreach B generate group, COUNT(A.$1);
+ grunt> explain C;
+ Logical Plan:
+ |---LOEval ( GENERATE {[PROJECT $0],[COUNT(GENERATE {[PROJECT $1]->[PROJECT $1]})]} ) 
+       |---LOCogroup ( GENERATE {[PROJECT $0],[*]} ) 
+             |---LOLoad ( file = /user/pig/tests/data/singlefile/studenttab10k AS name,age,gpa )
+ -----------------------------------------------
+ Physical Plan:
+ |---POMapreduce
+     Map : *
+     Combine : Generate(Project(0),FuncEval(org.apache.pig.builtin.COUNT$Initial(Generate(Composite(Project(1),Project(1))))))
+     Reduce : Generate(Project(0),FuncEval(org.apache.pig.builtin.COUNT$Final(Generate(Composite(Project(1),Project(1))))))
+     Grouping : Generate(Project(0),*)
+     Input File(s) : /user/pig/tests/data/singlefile/studenttab10k
+     Properties : pig.input.splittable:true
+ }}}
+ 
+ The output consists of two parts: logical plan and physical plan. The logical plan shows a pipeline of operators to be executed to build the relation. The physical plan shows how this is mapped to the physical backend; in this case - Hadoop.
+ 
  ==== help ====
  This command shows available commands.