@Override
  public ObjectInspector initialize(ObjectInspector[] arguments) throws UDFArgumentException {
    if (arguments.length != 4) {
      throw new UDFArgumentLengthException(
          "Requires 4 argument, got " + arguments.length);
    }
    if (!(arguments[0] instanceof ConstantObjectInspector)) {
      throw new UDFArgumentException(
          "The first argument should be a string constant, got " + arguments[0].getTypeName());
    }
    converters = new ObjectInspectorConverters.Converter[arguments.length];
    for (int i = 1; i < arguments.length; i++) {
      converters[i] = ObjectInspectorConverters.getConverter(arguments[i],
          PrimitiveObjectInspectorFactory.writableStringObjectInspector);
    }
    String tableName = ((ConstantObjectInspector) arguments[0]).getWritableConstantValue().toString();
    try {
      table = Hive.get().getTable(tableName);
      if (!table.isPartitioned()) {
        throw new UDFArgumentException("The input table: " + table + " isn't a partitioned table!");
      }
    } catch (Exception e) {
      if (e instanceof UDFArgumentException) {
        throw (UDFArgumentException) e;
      }
      throw new UDFArgumentException(e);
    }
    return PrimitiveObjectInspectorFactory.writableBooleanObjectInspector;
  }
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