@Override
  @Test
  public void testExchangePartitionOnlyMonthSetInPartSpec() throws Exception {
    Map<String, String> partitionSpecs = new HashMap<>();
    partitionSpecs.put(YEAR_COL_NAME, "");
    partitionSpecs.put(MONTH_COL_NAME, "march");
    partitionSpecs.put(DAY_COL_NAME, "");
    getClient().exchange_partitions(partitionSpecs, getSourceTable().getDbName(),
        getSourceTable().getTableName(), getDestTable().getDbName(), getDestTable().getTableName());
    checkRemainingPartitions(getSourceTable(), getDestTable(),
        Lists.newArrayList(getPartitions()[2], getPartitions()[3], getPartitions()[4]));
    List<Partition> exchangedPartitions = getClient().listPartitions(getDestTable().getDbName(),
        getDestTable().getTableName(), MAX);
    Assert.assertEquals(2, exchangedPartitions.size());
    checkExchangedPartitions(getSourceTable(), getDestTable(),
        Lists.newArrayList(getPartitions()[0], getPartitions()[1]));
  }
Test class for exchange partitions related methods on temporary tables.
ql/src/test/org/apache/hadoop/hive/ql/metadata/TestSessionHiveMetastoreClientExchangePartitionsTempTable.java