@Test
  public void testCacheIndexSameFieldName() throws Exception {
    Properties props = new Properties();
    props.setProperty(serdeConstants.LIST_COLUMNS, "a,b");
    props.setProperty(serdeConstants.LIST_COLUMN_TYPES,
        "int,struct<a:boolean>");
    props.setProperty(serdeConstants.TIMESTAMP_FORMATS, "millis");

    JsonSerDe serde = new JsonSerDe();
    serde.initialize(new Configuration(), props, null, false);

    List<?> results =
        (List<?>) serde.deserialize(new Text("{\"a\":5,\"b\":{\"a\":true}}"));
    Assert.assertNotNull(results);
    Assert.assertEquals(2, results.size());
    Assert.assertEquals(5, results.get(0));
    Assert.assertEquals(Arrays.asList(true), results.get(1));
  }
When parsing the JSON object, a cache is kept for the definition of each
field and it index in its most immediate struct. Check that if two names
have the same name, in the same index of their respective structs, that
they are not confused with one-another.
serde/src/test/org/apache/hadoop/hive/serde2/TestJsonSerDe.java