title: Extract ordered tuple values from a bag
body: <p>In pig I massaged my data into something like:</p>
  
  <pre><code>(a,{(b,c),(d,e),(f,g)})
  (h,{(i,j),(k,l)})
  </code></pre>
  
  <p>where the first item is the group and the bag are other values related to the group.  I would like to get it into  the following format:</p>
  
  <pre><code>(a,b,c,d,e,f,g)
  (h,i,j,k,l)
  </code></pre>
  
  <p>I got to where I am now with </p>
  
  <pre><code>grunt&gt; j = foreach G {            
  &gt;&gt;     o = order myvar by second;
  &gt;&gt;     generate group, o.(first,second);
  &gt;&gt; };
  </code></pre>
  
  <p>So the tuples in the bag are currently ordered.  If I do something like <code>mystuff = foreach j generate group, flatten($1);</code> I get it all flattened and un-grouped.</p>
  
  <p>Is this possible in pig, and if so what command should I be looking at?</p>