private void commitPartitionedTable() {
    try {
      transactionalHMSClient.run(
          c -> {
            if (!rewritePartitions.isEmpty()) {
              try {
                c.alterPartitions(
                    db, tableName, Lists.newArrayList(rewritePartitions.values()), null);
              } catch (InstantiationException
                  | NoSuchMethodException
                  | InvocationTargetException
                  | IllegalAccessException
                  | ClassNotFoundException e) {
                throw new RuntimeException(e);
              }
            }
            if (!newPartitions.isEmpty()) {
              c.addPartitions(Lists.newArrayList(newPartitions.values()));
            }
            return 0;
          });
    } catch (TException | InterruptedException e) {
      throw new RuntimeException(e);
    }
  }
check files in the partition, and delete orphan files
amoro-format-mixed/amoro-mixed-hive/src/main/java/org/apache/amoro/hive/op/ReplaceHivePartitions.java