@Test
  public void testLooseJsonReadability() throws Exception {
    Configuration conf = new Configuration();
    Properties props = new Properties();

    props.put(serdeConstants.LIST_COLUMNS, "s,k");
    props.put(serdeConstants.LIST_COLUMN_TYPES, "struct<a:int,b:string>,int");
    JsonSerDe rjsd = new JsonSerDe();
    rjsd.initialize(conf, props, null);

    Text jsonText = new Text("{ \"x\" : \"abc\" , "
        + " \"t\" : { \"a\":\"1\", \"b\":\"2\", \"c\":[ { \"x\":2 , \"y\":3 } , { \"x\":3 , \"y\":2 }] } ,"
        +"\"s\" : { \"a\" : 2 , \"b\" : \"blah\", \"c\": \"woo\" } }");
    List<Object> expected = new ArrayList<Object>();
    List<Object> inner = new ArrayList<Object>();
    inner.add(2);
    inner.add("blah");
    expected.add(inner);
    expected.add(null);
    HCatRecord expectedRecord = new DefaultHCatRecord(expected);

    HCatRecord r = (HCatRecord) rjsd.deserialize(jsonText);
    System.err.println("record : " + r.toString());

    assertTrue(HCatDataCheckUtil.recordsEqual(r, expectedRecord));

  }
This test tests that our json deserialization is not too strict, as per HIVE-6166

i.e, if our schema is "s:struct<a:int,b:string>,k:int", and we pass in
data that looks like : {
                           "x" : "abc" ,
                           "t" : {
                               "a" : "1",
                               "b" : "2",
                               "c" : [
                                   { "x" : 2 , "y" : 3 } ,
                                   { "x" : 3 , "y" : 2 }
                               ]
                           } ,
                           "s" : {
                               "a" : 2 ,
                               "b" : "blah",
                               "c": "woo"
                           }
                       }

Then it should still work, and ignore the "x" and "t" field and "c" subfield of "s", and it
should read k as null.
hcatalog/core/src/test/java/org/apache/hive/hcatalog/data/TestJsonSerDe.java