private void commitPartitionedTable() {
    if (!partitionToDelete.isEmpty()) {
      for (Partition p : partitionToDelete.values()) {
        try {
          transactionClient.run(
              c -> {
                PartitionDropOptions options =
                    PartitionDropOptions.instance()
                        .deleteData(false)
                        .ifExists(true)
                        .purgeData(false)
                        .returnResults(false);
                c.dropPartition(db, tableName, p.getValues(), options);
                return 0;
              });
        } catch (NoSuchObjectException e) {
          LOG.warn("try to delete hive partition {} but partition not exist.", p);
        } catch (TException | InterruptedException e) {
          throw new RuntimeException(e);
        }
      }
    }

    if (!partitionToCreate.isEmpty()) {
      try {
        transactionClient.run(c -> c.addPartitions(Lists.newArrayList(partitionToCreate.values())));
      } catch (TException | InterruptedException e) {
        throw new RuntimeException(e);
      }
    }

    if (!partitionToAlter.isEmpty()) {
      try {
        transactionClient.run(
            c -> {
              try {
                c.alterPartitions(
                    db, tableName, Lists.newArrayList(partitionToAlter.values()), null);
              } catch (InvocationTargetException
                  | InstantiationException
                  | IllegalAccessException
                  | NoSuchMethodException
                  | ClassNotFoundException e) {
                throw new RuntimeException(e);
              }
              return null;
            });
      } catch (TException | InterruptedException e) {
        throw new RuntimeException(e);
      }
    }
  }
filter partitionToCreate. make sure all partition non-exist in hive. or 0. partition is able to
delete. 0.1 - not same location, allow to create 0.2 - same location, can't create ( delete
partition will not delete files ) 1. exists but location is same. skip 2. exists but location
is not same, throw {@link CannotAlterHiveLocationException}
amoro-format-mixed/amoro-mixed-hive/src/main/java/org/apache/amoro/hive/op/UpdateHiveFiles.java