title: Join two file data in pig to the output in a desired format
body: <p>File 1 has the data:</p>
  
  <pre><code>Name ID 
  -------
  Mark 1
  Gary 2
  Robert 3
  </code></pre>
  
  <p>File 2 has the data:</p>
  
  <pre><code>ID  result
  ----------
  1   success
  2   Fail 
  3   success
  </code></pre>
  
  <p>I loaded the data into two variables <code>a</code> &amp; <code>b</code> now I want to join the data in based on ID for which result is success. I am able to join but I am getting the data in an improper format.</p>
  
  <pre><code>a = load '/file1' as (Name:chararray,ID:int);
  b = load '/file2' as (ID:int,result:chararray);
  c = join a by a2, b by b1;
  </code></pre>
  
  <p>When I dump c I am getting the output in the format of <strong>(name,id,id,result)</strong>... How I need join <code>a</code> &amp; <code>b</code> such that I can get the output in the format of <strong><em>(name,id,result)</em></strong></p>