private Map<String, Object> makeOneTableStatus(Table table, Hive db, HiveConf conf, Partition partition)
      throws HiveException, IOException {
    StorageInfo storageInfo = getStorageInfo(table, partition);

    MapBuilder builder = MapBuilder.create();
    builder.put("tableName", table.getTableName());
    builder.put("ownerType", (table.getOwnerType() != null) ? table.getOwnerType().name() : "null");
    builder.put("owner", table.getOwner());
    builder.put("location", storageInfo.location);
    builder.put("inputFormat", storageInfo.inputFormatClass);
    builder.put("outputFormat", storageInfo.outputFormatClass);
    builder.put("columns", JsonDescTableFormatter.createColumnsInfo(table.getCols(), Collections.emptyList()));

    builder.put("partitioned", table.isPartitioned());
    if (table.isPartitioned()) {
      builder.put("partitionColumns", JsonDescTableFormatter.createColumnsInfo(table.getPartCols(),
          Collections.emptyList()));
    }

    if (table.getTableType() != TableType.VIRTUAL_VIEW) {
      putFileSystemStats(builder, getLocations(db, partition, table), conf, table.getPath());
    }

    return builder.build();
  }
Formats SHOW TABLE STATUS commands to json format.
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/info/show/status/formatter/JsonShowTableStatusFormatter.java