@Override
  public void describeTable(HiveConf conf, DataOutputStream out, String columnPath, String tableName, Table table,
      Partition partition, List<FieldSchema> columns, boolean isFormatted, boolean isExtended, boolean isOutputPadded,
      List<ColumnStatisticsObj> columnStats) throws HiveException {
    MapBuilder builder = MapBuilder.create();
    builder.put("columns", createColumnsInfo(columns, columnStats));

    if (isExtended) {
      addExtendedInfo(table, partition, builder);
    }

    ShowUtils.asJson(out, builder.build());
  }
Formats DESC TABLE results to json format.
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/info/desc/formatter/JsonDescTableFormatter.java