public static void asJson(OutputStream out, Map<String, Object> data) throws HiveException {
    try {
      new ObjectMapper().writeValue(out, data);
    } catch (IOException e) {
      throw new HiveException("Unable to convert to json", e);
    }
  }
Convert the map to a JSON string.
ql/src/java/org/apache/hadoop/hive/ql/ddl/ShowUtils.java