title: How can I split a Pig tuple into subtuples?
body: <p>Here are the tuples that I am manipulating in a Pig script:</p>
  
  <pre><code>DUMP A
  (4,20,53,31)
  (21,3,40,16)
  (15,51,12,3)
  </code></pre>
  
  <p>I would transform this relation (A) into another relation (B) such as:</p>
  
  <pre><code>DUMP B
  (4,20)
  (4,53)
  (4,31)
  (21,3)
  (21,40)
  (21,16)
  (15,51)
  (15,12)
  (15,3)
  </code></pre>
  
  <p>That means keeping the first field in all tuples and get one tuple by each field. In the previous example, each tuple must give 3 new tuples. I have a solution to get: </p>
  
  <pre><code>DUMP B
  (4,20)
  (21,3)
  (15,51)
  (4,53)
  (21,40)
  (15,12)
  (4,31)
  (21,16)
  (15,3)
  </code></pre>
  
  <p>Which is the good result but with the wrong order (I use the FOREACH operator each time). I could get the right order by adding a field to each tuple and then using the ORDER operator but I think there is a simpler way to do so.</p>
  
  <p>Any idea?</p>
  
  <p>Thank you.</p>