@Test
  public void testMapNumericKey() throws Exception {
    Properties props = new Properties();
    props.setProperty(serdeConstants.LIST_COLUMNS, "map");
    props.setProperty(serdeConstants.LIST_COLUMN_TYPES, "map<int,string>");
    props.setProperty(serdeConstants.TIMESTAMP_FORMATS, "millis");

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

    final String jsonText = loadJson("map_int_key.json");

    final Text text = new Text(jsonText);
    final List<?> results = (List<?>) serde.deserialize(text);

    Assert.assertNotNull(results);
    Assert.assertEquals(1, results.size());

    Map<?, ?> resultMap = (Map<?, ?>) results.get(0);
    Object value1 = resultMap.get(1);
    Object value2 = resultMap.get(2);

    Assert.assertEquals(2, resultMap.size());
    Assert.assertEquals("2001-01-01", value1);
    Assert.assertEquals(null, value2);
  }
Test when a map has a key defined as a numeric value. Technically, JSON
does not support this because each key in a map must be a quoted string.
Unquoted strings (hence an int value) is allowed by JavaScript, but not by
JSON specification. For Hive, the int map key type is stored as a string
and must be converted back into an int type.
serde/src/test/org/apache/hadoop/hive/serde2/TestJsonSerDe.java