public static void alterPartition(
      HMSClientPool hiveClient, TableIdentifier tableIdentifier, String partition, String newPath)
      throws IOException {
    try {
      LOG.info(
          "alter table {} hive partition {} to new location {}",
          tableIdentifier,
          partition,
          newPath);
      Partition oldPartition =
          hiveClient.run(
              client ->
                  client.getPartition(
                      tableIdentifier.getDatabase(), tableIdentifier.getTableName(), partition));
      Partition newPartition = new Partition(oldPartition);
      newPartition.getSd().setLocation(newPath);
      hiveClient.run(
          (ClientPool.Action<Void, HMSClient, TException>)
              client -> {
                try {
                  client.alterPartition(
                      tableIdentifier.getDatabase(),
                      tableIdentifier.getTableName(),
                      newPartition,
                      null);
                } catch (ClassNotFoundException
                    | NoSuchMethodException
                    | InvocationTargetException
                    | IllegalAccessException e) {
                  throw new RuntimeException(e);
                }
                return null;
              });
    } catch (Exception e) {
      throw new IOException(e);
    }
  }
Change the Hive partition location.

@param hiveClient Hive client from MixedHiveCatalog
@param tableIdentifier A table identifier
@param partition A Hive partition name
@param newPath Target partition location
amoro-format-mixed/amoro-mixed-hive/src/main/java/org/apache/amoro/hive/utils/HivePartitionUtil.java