title: bags to tuples in pig
body: <p>I have four columns A,B,C,D
  where column D has all the values same(eg:'d')
  Data is </p>
  
  <pre><code>A,B,C,D
  1,b,1,d
  2,x,3,d
  3,y,3,d
  </code></pre>
  
  <p>I want to find the median on C and store under column <code>Median</code>.Rest of  A,B,C,D should be as usual.
  1)performed group on D
  2)found median on C using apache fu package(<a href="http://datafu.incubator.apache.org/docs/datafu/getting-started.html" rel="nofollow">http://datafu.incubator.apache.org/docs/datafu/getting-started.html</a>).</p>
  
  <p>I want </p>
  
  <pre><code>A,B,C,D,Median
  1,b,1,d,3
  2,x,3,d,3
  3,y,3,d,3
  </code></pre>
  
  <p>but i get </p>
  
  <pre><code>{A: {(A: long)},B: {(B: chararray)},C: {(C: long)},D: {(B: chararray)},Median: (quantile_0_5: double),}
  </code></pre>
  
  <p>I want all that bags to be removed and be used as tuples.
  Can somebody suggest something to get desired output?</p>