@Test
  public void testAddPartitionSpecEmptyLocationInTableToo() throws Exception {

    Table table = createTable(DB_NAME, TABLE_NAME, getYearPartCol(), null);
    Partition partition = buildPartition(DB_NAME, TABLE_NAME, DEFAULT_YEAR_VALUE, "");
    PartitionSpecProxy partitionSpecProxy =
        buildPartitionSpec(DB_NAME, TABLE_NAME, null, Lists.newArrayList(partition));
    client.add_partitions_pspec(partitionSpecProxy);

    Partition resultPart =
        client.getPartition(DB_NAME, TABLE_NAME, Lists.newArrayList(DEFAULT_YEAR_VALUE));
    Assert.assertEquals(table.getSd().getLocation() + "/year=2017",
        resultPart.getSd().getLocation());
    Assert.assertTrue(metaStore.isPathExists(new Path(resultPart.getSd().getLocation())));
  }
Tests for creating partitions from partition spec.
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/client/TestAddPartitionsFromPartSpec.java