title: accessing an element like array in pig
body: <p>I have data in the form:
  id,val1,val2</p>
  
  <p>example</p>
  
  <pre><code>1,0.2,0.1
  1,0.1,0.7
  1,0.2,0.3
  2,0.7,0.9
  2,0.2,0.3
  2,0.4,0.5
  </code></pre>
  
  <p>So first I want to sort each id by val1 in decreasing order..so somethng like</p>
  
  <pre><code>1,0.2,0.1
  1,0.2,0.3
  1,0.1,0.7
  2,0.7,0.9
  2,0.4,0.5
  2,0.2,0.3
  </code></pre>
  
  <p>And then select the second element id,val2 combination for each id
  So for example:</p>
  
  <pre><code>  1,0.3
    2,0.5
  </code></pre>
  
  <p>How do I approach this?</p>
  
  <p>Thanks</p>