@Test
  @ConditionalIgnoreOnSessionHiveMetastoreClient
  public void testAddPartitionSpecUpperCaseDBAndTableNameInOnePart() throws Exception {

    String tableName = "test_add_part_table";
    String tableLocation = metaStore.getWarehouseRoot() + "/" + tableName.toUpperCase();
    createTable(DB_NAME, tableName, getYearPartCol(), tableLocation);

    Partition partition1 = buildPartition(DB_NAME, tableName, "2013",
        tableLocation + "/year=2013");
    Partition partition2 = buildPartition(DB_NAME.toUpperCase(), tableName.toUpperCase(), "2014",
        tableLocation + "/year=2014");
    List<Partition> partitions = Lists.newArrayList(partition1, partition2);

    String rootPath = tableLocation + "/addpartspectest/";
    PartitionSpecProxy partitionSpec = buildPartitionSpec(DB_NAME, tableName, rootPath, partitions);
    client.add_partitions_pspec(partitionSpec);

    Partition part = client.getPartition(DB_NAME, tableName, "year=2013");
    Assert.assertNotNull(part);
    Assert.assertEquals(tableName, part.getTableName());
    Assert.assertEquals(DB_NAME, part.getDbName());
    Assert.assertEquals(tableLocation + "/year=2013", part.getSd().getLocation());
    part = client.getPartition(DB_NAME, tableName, "year=2014");
    Assert.assertNotNull(part);
    Assert.assertEquals(tableName, part.getTableName());
    Assert.assertEquals(DB_NAME, part.getDbName());
    Assert.assertEquals(tableLocation + "/year=2014", part.getSd().getLocation());
  }
Tests for creating partitions from partition spec.
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/client/TestAddPartitionsFromPartSpec.java