public void setValues(Map<String, String> partSpec)
      throws HiveException {
    List<String> pvals = new ArrayList<String>();
    for (FieldSchema field : table.getPartCols()) {
      String val = partSpec.get(field.getName());
      if (val == null) {
        throw new HiveException(
            "partition spec is invalid. field.getName() does not exist in input.");
      }
      pvals.add(val.intern());
    }
    tPartition.setValues(pvals);
  }
Set Partition's values

@param partSpec
         Partition specifications.
@throws HiveException
          Thrown if we could not create the partition.
ql/src/java/org/apache/hadoop/hive/ql/metadata/Partition.java