title: what is the distinction between an 'outer bag' and an 'inner bag' in pigLatin?
body: <p>the manual/documentation uses the language of 'inner bag' and 'outer bag' extensively (say: <a href="http://pig.apache.org/docs/r0.11.1/basic.html">http://pig.apache.org/docs/r0.11.1/basic.html</a>  ), and yet I haven't been able to pin out clearly the precise definition separating the terms.  </p>
  
  <p>e.g. all inherently interrelated: </p>
  
  <ul>
  <li>If I give you a bag 'foo,' what would you need to know to label foo as an 'inner bag' vs. an 'outer bag'?</li>
  <li>Is 'any bag' who is not the most outer-bag then ' an inner bag' ?</li>
  <li>Are the labels of inner and outer always exclusive? </li>
  <li>In PigLatin, are all 'bags' 'relations' -- or is only 'the most outer bag' a relation?  (and inner bags are not relations)</li>
  </ul>
  
  <p>to create a discussable example: </p>
  
  <pre><code>grunt&gt; dump A;      
  (1,2,3)
  (4,2,1)
  (8,3,4)
  (4,3,3)
  
  
  grunt&gt; W1 = GROUP A   ALL;         
  grunt&gt; W2 = GROUP W1  ALL;
  grunt&gt; W3 = GROUP W2  ALL;
  grunt&gt; W4 = GROUP W3  ALL;
  
  grunt&gt; describe W4;
  W4: {group: chararray,W3: {(group: chararray,W2: {(group: chararray,W1: {(group: chararray,A: {(f1: int,f2: int,f3: int)})})})}}
  
  
  grunt&gt; illustrate W4;
  (1,2,3)
  ---------------------------------------------------
  | A     | f1:int      | f2:int      | f3:int      | 
  ---------------------------------------------------
  |       | 1           | 2           | 3           | 
  |       | 8           | 3           | 4           | 
  ---------------------------------------------------
  ------------------------------------------------------------------------------------------------
  | W1     | group:chararray      | A:bag{:tuple(f1:int,f2:int,f3:int)}                          | 
  ------------------------------------------------------------------------------------------------
  |        | all                  | {(1, 2, 3), (8, 3, 4)}                                       | 
  ------------------------------------------------------------------------------------------------
  -----------------------------------------------------------------------------------------------------------------------------------------------
  | W2     | group:chararray      | W1:bag{:tuple(group:chararray,A:bag{:tuple(f1:int,f2:int,f3:int)})}                                         | 
  -----------------------------------------------------------------------------------------------------------------------------------------------
  |        | all                  | {(all, {(1, 2, 3), (8, 3, 4)})}                                                                             | 
  -----------------------------------------------------------------------------------------------------------------------------------------------
  ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  | W3     | group:chararray      | W2:bag{:tuple(group:chararray,W1:bag{:tuple(group:chararray,A:bag{:tuple(f1:int,f2:int,f3:int)})})}                                                        | 
  ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  |        | all                  | {(all, {(all, {(1, 2, 3), (8, 3, 4)})})}                                                                                                                   | 
  ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  | W4     | group:chararray      | W3:bag{:tuple(group:chararray,W2:bag{:tuple(group:chararray,W1:bag{:tuple(group:chararray,A:bag{:tuple(f1:int,f2:int,f3:int)})})})}                                                                       | 
  ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  |        | all                  | {(all, {(all, {(all, {(1, 2, 3), (8, 3, 4)})})})}                                                                                                                                                         | 
  ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  
  grunt&gt; dump W4;
  (all,{(all,{(all,{(all,{(1,2,3),(4,2,1),(8,3,4),(4,3,3)})})})})
  </code></pre>
  
  <p>amongst the bags - W1, W2, W3, W4  -- which is inner, which is outer? </p>