title: How to insert a complex dynamic nested json into bigquery using java
body: <p>I am using the JSON that is coming from the xAPI system and the JSON looks similar to the one available in the <a href="https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-About.md#Appendix1B%20And%20I%20need%20to%20insert%20into%20this%20json" rel="nofollow noreferrer">link</a> into BigQuery where in the schema of the BigQuery is slightly altered.</p>
  
  <p>Example: In the JSON for the child element <code>verb</code></p>
  
  <pre class="lang-json prettyprint-override"><code>"verb":{  
      "id":"http://adlnet.gov/expapi/verbs/failed",
      "display":{  
        "en-US":"failed"
      }
    }
  </code></pre>
  
  <p>The schema is like below:</p>
  
  <pre><code>verb                        RECORD  NULLABLE    
  verb.id                     STRING  NULLABLE    
  verb.display                RECORD  REPEATED    
  verb.display.stringValue    STRING  NULLABLE    
  verb.display.languageCode   STRING  NULLABLE
  </code></pre>
  
  <p>If I use the jackson <code>ObjectMapper</code>, the JSON gets parsed but it doesn't get inserted to the BigQuery because in the JSON the <code>display</code> is only a record but in the BigQuery it is a list of records, so there seems to be a mismatch and I am unable to insert such custom fields. </p>
  
  <p>Please provide any solutions to tackle this problem, in short whereever in the JSON from the link above provided there is "en", I am facing this issue.</p>
  
  <p>Any help is appreciated.        </p>
  
  <pre><code>ObjectMapper objectmapper = new ObjectMapper();  
  objectmapper.configure(SerializationFeature.WRITE_NULL_MAP_VALUES, false); 
  objectmapper.setSerializationInclusion(Include.NON_NULL);
  ashMap&lt;String, Object&gt; tempResult = objectmapper.readValue(stageJson, HashMap.class);
  </code></pre>