private void writeColumnsInfo(DataOutputStream out, Table table) throws IOException, UnsupportedEncodingException {
    String columns = MetaStoreUtils.getDDLFromFieldSchema("columns", table.getCols());
    String partitionColumns = table.isPartitioned() ?
        MetaStoreUtils.getDDLFromFieldSchema("partition_columns", table.getPartCols()) : "";

    out.write(Utilities.newLineCode);
    out.write(("columns:" + columns).getBytes(StandardCharsets.UTF_8));
    out.write(Utilities.newLineCode);
    out.write(("partitioned:" + table.isPartitioned()).getBytes(StandardCharsets.UTF_8));
    out.write(Utilities.newLineCode);
    out.write(("partitionColumns:" + partitionColumns).getBytes(StandardCharsets.UTF_8));
    out.write(Utilities.newLineCode);
  }
Formats SHOW TABLE STATUS commands to text format.
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/info/show/status/formatter/TextShowTableStatusFormatter.java