Partition addPartition(Partition p) throws AlreadyExistsException, MetaException {
    String partName = makePartName(tTable.getPartitionKeys(), p.getValues());
    Partition partition = pTree.addPartition(p, partName, false);
    return partition == null ? pTree.getPartition(partName) : partition;
  }
This stores partition information for a temp table.
ql/src/java/org/apache/hadoop/hive/ql/metadata/TempTable.java