@Override
  public org.apache.hadoop.hive.metastore.api.Partition add_partition(
      org.apache.hadoop.hive.metastore.api.Partition partition) throws TException {
    // First try temp table
    if (partition == null) {
      throw new MetaException("Partition cannot be null");
    }
    org.apache.hadoop.hive.metastore.api.Table table =
        getTempTable(partition.getDbName(), partition.getTableName());
    if (table == null) {
      //(assume) not a temp table - Try underlying client
      return super.add_partition(partition);
    }
    TempTable tt = getPartitionedTempTable(table);
    checkPartitionProperties(partition);
    Path partitionLocation = getPartitionLocation(table, partition, false);
    Partition result = tt.addPartition(deepCopy(partition));
    createAndSetLocationForAddedPartition(result, partitionLocation);
    return result;
  }
Hive.loadPartition() calls this.
@param partition
         The partition to add
@return the partition added
ql/src/java/org/apache/hadoop/hive/ql/metadata/SessionHiveMetaStoreClient.java