@Override
  public Partition exchange_partition(Map<String, String> partitionSpecs, String sourceCatName,
      String sourceDbName, String sourceTableName, String destCatName, String destDbName, String destTableName)
      throws TException {
    org.apache.hadoop.hive.metastore.api.Table sourceTempTable = getTempTable(sourceDbName, sourceTableName);
    org.apache.hadoop.hive.metastore.api.Table destTempTable = getTempTable(destDbName, destTableName);
    if (sourceTempTable == null && destTempTable == null) {
      return super
          .exchange_partition(partitionSpecs, sourceCatName, sourceDbName, sourceTableName, destCatName, destDbName,
              destTableName);
    } else if (sourceTempTable != null && destTempTable != null) {
      TempTable sourceTT = getPartitionedTempTable(sourceTempTable);
      TempTable destTT = getPartitionedTempTable(destTempTable);
      List<Partition> partitions = exchangePartitions(partitionSpecs, sourceTempTable, sourceTT, destTempTable, destTT);
      if (!partitions.isEmpty()) {
        return partitions.get(0);
      }
    }
    throw new MetaException("Exchanging partitions between temporary and non-temporary tables is not supported.");
  }
@param partialPvals partition values, can be partial.  This really means that missing values
                   are represented by empty str.
@param maxParts maximum number of partitions to fetch, or -1 for all
ql/src/java/org/apache/hadoop/hive/ql/metadata/SessionHiveMetaStoreClient.java