@Override
  public int execute() throws HiveException {
    String tableName = desc.getTableName();

    // show table properties - populate the output stream
    Table tbl = context.getDb().getTable(tableName, false);
    try {
      if (tbl == null) {
        String errMsg = "Table " + tableName + " does not exist";
        ShowUtils.writeToFile(errMsg, desc.getResFile(), context);
        return 0;
      }

      LOG.info("DDLTask: show properties for {}", tableName);

      StringBuilder builder = new StringBuilder();
      String propertyName = desc.getPropertyName();
      if (propertyName != null) {
        String propertyValue = tbl.getProperty(propertyName);
        if (propertyValue == null) {
          String errMsg = "Table " + tableName + " does not have property: " + propertyName;
          builder.append(errMsg);
        } else {
          ShowUtils.appendNonNull(builder, propertyName, true);
          ShowUtils.appendNonNull(builder, propertyValue);
        }
      } else {
        Map<String, String> properties = new TreeMap<String, String>(tbl.getParameters());
        for (Entry<String, String> entry : properties.entrySet()) {
          ShowUtils.appendNonNull(builder, entry.getKey(), true);
          ShowUtils.appendNonNull(builder, entry.getValue());
        }
      }

      LOG.info("DDLTask: written data for showing properties of {}", tableName);
      ShowUtils.writeToFile(builder.toString(), desc.getResFile(), context);
    } catch (IOException e) {
      LOG.info("show table properties: ", e);
      return 1;
    } catch (Exception e) {
      throw new HiveException(e);
    }

    return 0;
  }
Operation process showing the table status.
ql/src/java/org/apache/hadoop/hive/ql/ddl/table/info/show/properties/ShowTablePropertiesOperation.java