public Response descOnePartition(String user, String db, String table,
                   String partition)
    throws HcatException, NotAuthorizedException, BusyException,
    ExecuteException, IOException {
    String exec = "use " + db + "; ";
    exec += "show table extended like " + table
      + " partition (" + partition + "); ";
    try {
      String res = jsonRun(user, exec);
      return JsonBuilder.create(singleTable(res, table))
        .remove("tableName")
        .put("database", db)
        .put("table", table)
        .put("partition", partition)
        .build();
    } catch (HcatException e) {
      if (e.execBean.stderr.contains("SemanticException") &&
        e.execBean.stderr.contains("Partition not found")) {
        String emsg = "Partition " + partition + " for table "
          + table + " does not exist" + db + "." + table + " does not exist";
        return JsonBuilder.create()
          .put("error", emsg)
           //this error should really be produced by Hive (DDLTask)
          .put("errorCode", ErrorMsg.INVALID_PARTITION.getErrorCode())
          .put("database", db)
          .put("table", table)
          .put("partition", partition)
          .build();
      }

      throw new HcatException("unable to show partition: "
        + table + " " + partition,
        e.execBean,
        exec);
    }
  }
Return a json description of one partition.
hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/HcatDelegator.java