title: Loading json with varying schema into PIG
body: <p>I ran into an issue loading a set json documents into PIG.
  What I have is a lot of json documents that all vary in the fields they have, the fields that I need are in most documents and in whare missing I would like to get a null value.</p>
  
  <p>I just downloaded and compiled the latest Pig version (0.12 straight from the apache git repository) just to be sure this hasn't been solved yet.</p>
  
  <p>What I have is a json document like this:</p>
  
  <pre><code>{"foo":1,"bar":2,"baz":3}
  </code></pre>
  
  <p>When I load this into PIG using this </p>
  
  <pre><code>Json1 = LOAD 'test.json' USING JsonLoader('foo:int,bar:int,baz:int');
  DESCRIBE Json1;
  DUMP Json1;
  </code></pre>
  
  <p>I get the expected results</p>
  
  <pre><code>Json1: {foo: int,bar: int,baz: int}
  (1,2,3)
  </code></pre>
  
  <p>However when the fields are in a different order in the schema :</p>
  
  <pre><code>Json2 = LOAD 'test.json' USING JsonLoader('baz:int,bar:int,foo:int');
  DESCRIBE Json2;
  DUMP Json2;
  </code></pre>
  
  <p>I get an undesired result:</p>
  
  <pre><code>Json2: {baz: int,bar: int,foo: int}
  (1,2,3)
  </code></pre>
  
  <p>That should have been </p>
  
  <pre><code>(3,2,1)
  </code></pre>
  
  <p>Apparently the field names in the schema definition have nothing to do with the fieldnames in the json. </p>
  
  <p>What I need is to load specific fields from a json file (with embedded documents!) into PIG.</p>
  
  <p>How do I resolve this?</p>