private StorageDescriptor buildSD(String location) {
    StorageDescriptor sd = new StorageDescriptor();
    sd.setInputFormat("TestInputFormat");
    sd.setOutputFormat("TestOutputFormat");
    sd.setCols(getYearPartCol());
    sd.setCompressed(false);
    Map<String, String> parameters = new HashMap<>();
    parameters.put("testSDParamKey", "testSDParamValue");
    sd.setParameters(parameters);
    sd.setLocation(location);
    SerDeInfo serdeInfo = new SerDeInfo();
    serdeInfo.setName("sharedSDPartSerde");
    sd.setSerdeInfo(serdeInfo);
    return sd;
  }
Tests for creating partitions from partition spec.
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/client/TestAddPartitionsFromPartSpec.java