title: Load JSON format table into Pig
body: <p>I have a table created with Hive. It takes a <code>JSON</code> format data (I have used <code>SERDE</code> to create it).</p>
  
  <p>I would like to know if it is possible to load data from this table to <code>Pig</code> and then make some transformations.</p>
  
  <p>This is my JSON data:</p>
  
  <pre><code>{"id":"1", "word":"2" ,"flag":1}.
  </code></pre>
  
  <p>Do you have any clue?</p>
  
  <hr>
  
  <p>I have tried </p>
  
  <pre><code>A = LOAD ‘data.json’
  USING PigJsonLoader();
  </code></pre>
  
  <p>but with no success. This is the error I get:</p>
  
  <blockquote>
    <p>[main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 1200:   Unexpected character ''</p>
  </blockquote>
  
  <p>I turned to </p>
  
  <pre><code>json_objects = LOAD 'hdfs://user/cloudera/test.json' 
                 USING org.apache.pig.piggybank.storage.JsonLoader();
  </code></pre>
  
  <p>but it says:</p>
  
  <blockquote>
    <p>Could not resolve org.apache.pig.piggybank.storage.JsonLoader using
    imports: [, org.apache.pig.builtin., org.apache.pig.impl.builtin.].</p>
  </blockquote>