public static HCatSchema getPartitionColumns(Table table) throws IOException {
    HCatSchema cols = new HCatSchema(new LinkedList<HCatFieldSchema>());
    if (table.getPartitionKeys().size() != 0) {
      for (FieldSchema fs : table.getPartitionKeys()) {
        cols.append(HCatSchemaUtils.getHCatFieldSchema(fs));
      }
    }
    return cols;
  }
return the partition columns from a table instance

@param table the instance to extract partition columns from
@return HCatSchema instance which contains the partition columns
@throws IOException
hcatalog/core/src/main/java/org/apache/hive/hcatalog/common/HCatUtil.java