public static PartitionDesc getPartitionDesc(Partition part, TableDesc tableDesc) throws
      HiveException {
    return new PartitionDesc(part, tableDesc);
  }
Gets the task id if we are running as a Hadoop job. Gets a random number otherwise.
ql/src/java/org/apache/hadoop/hive/ql/exec/Utilities.java