title: Sort related bag
body: <p>I have a Pig script which generated a relation </p>
  
  <pre><code>A: {x: chararray,B: {(y: chararray,z: int)}}
  </code></pre>
  
  <p>I want to sort A based on B.y, however the following piece gives me error:</p>
  
  <blockquote>
    <p>Syntax error, unexpected symbol at or near z</p>
  </blockquote>
  
  <pre><code>output = foreach A{
      sorted = order B by z DSC;
      generate x,sorted;
  }
  </code></pre>