private void getPrimaryKeyInformation(StringBuilder constraintsInfo, PrimaryKeyInfo constraint) {
    formatOutput("Table:", constraint.getDatabaseName() + "." + constraint.getTableName(), constraintsInfo);
    formatOutput("Constraint Name:", constraint.getConstraintName(), constraintsInfo);
    Map<Integer, String> columnNames = constraint.getColNames();
    String title = "Column Name:";
    for (String columnName : columnNames.values()) {
      constraintsInfo.append(String.format("%-" + ALIGNMENT + "s", title) + FIELD_DELIM);
      formatOutput(new String[] {columnName}, constraintsInfo);
    }
  }
Formats DESC TABLE results to text format.
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/info/desc/formatter/TextDescTableFormatter.java