@Override
  public Object evaluate(DeferredObject[] arguments) throws HiveException {
    ret.set(false);
    if (arguments[1].get() == null || arguments[2].get() == null ||
        arguments[3].get() == null) {
      return ret;
    }
    String partName   = converters[1].convert(arguments[1].get()).toString();
    String paramKey   = converters[2].convert(arguments[2].get()).toString();
    String paramValue = converters[3].convert(arguments[3].get()).toString();
    try {
      List<Partition> partitionList = Hive.get()
          .getPartitionsByNames(table, Arrays.asList(partName));
      if (partitionList == null || partitionList.isEmpty()) {
        return ret;
      }
      Partition partition = partitionList.get(0);
      partition.getParameters().put(paramKey, paramValue);
      Hive.get()
          .alterPartition(table.getCatName(), table.getDbName(), table.getTableName(), partition, null, true);
      ret.set(true);
    } catch (Exception e) {
      LOG.debug("Error while altering the partition's parameters", e);
    }
    return ret;
  }
This class is for testing only, will try to alter the partition's parameters with the input key value pairs.
itests/qtest/src/test/java/org/apache/hadoop/hive/udf/example/AlterPartitionParamsExample.java