public static PartitionDesc getPartitionDescFromTableDesc(TableDesc tblDesc, Partition part,
    boolean usePartSchemaProperties) throws HiveException {
    return new PartitionDesc(part, tblDesc, usePartSchemaProperties);
  }
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