@Override
  public HCatTable deserializeTable(String hcatTableStringRep) throws HCatException {
    try {
      Table table = new Table();
      new TDeserializer(new TJSONProtocol.Factory()).deserialize(table, hcatTableStringRep, "UTF-8");
      return new HCatTable(table);
    }
    catch(TException exception) {
      if (LOG.isDebugEnabled())
        LOG.debug("Could not de-serialize from: " + hcatTableStringRep);
      throw new HCatException("Could not de-serialize HCatTable.", exception);
    }
  }
MetadataSerializer implementation, that serializes HCat API elements into JSON.
hcatalog/webhcat/java-client/src/main/java/org/apache/hive/hcatalog/api/MetadataJSONSerializer.java