public static String getPartialName(Partition p, int level) throws HiveException {
    List<FieldSchema> fields = p.getTable().getPartCols().subList(0, level);
    List<String> values = p.getValues().subList(0, level);
    try {
      return Warehouse.makePartName(fields, values);
    } catch (MetaException e) {
      throw new HiveException("Wasn't able to generate name" +
                                " for partial specification");
    }
  }
Get a prefix of the given parition's string representation. The second
argument, level, is used for the prefix length. For example, partition
(ds='2010-01-01', hr='00', min='00'), level 1 will return 'ds=2010-01-01',
and level 2 will return 'ds=2010-01-01/hr=00'.

@param p
         partition object
@param level
         level for prefix depth
@return prefix of partition's string representation
@throws HiveException
ql/src/java/org/apache/hadoop/hive/ql/exec/ArchiveUtils.java