private StructLikeMap<Partition> filterNewPartitionNonExists(
      StructLikeMap<Partition> partitionToCreate, StructLikeMap<Partition> partitionToDelete) {
    StructLikeMap<Partition> partitions = StructLikeMap.create(table.spec().partitionType());
    Map<String, Partition> deletePartitionValueMap = Maps.newHashMap();
    for (Partition p : partitionToDelete.values()) {
      String partValue = Joiner.on("/").join(p.getValues());
      deletePartitionValueMap.put(partValue, p);
    }

    for (Map.Entry<StructLike, Partition> entry : partitionToCreate.entrySet()) {
      String partValue = Joiner.on("/").join(entry.getValue().getValues());
      String location = entry.getValue().getSd().getLocation();
      Partition toDelete = deletePartitionValueMap.get(partValue);
      if (toDelete != null) {
        String deleteLocation = toDelete.getSd().getLocation();
        // if exists partition to delete with same value
        // make sure location is different
        if (isPathEquals(location, deleteLocation) && validateLocation) {
          throw new CannotAlterHiveLocationException(
              "can't create new partition: "
                  + partitionToString(entry.getValue())
                  + ", this "
                  + "partition will be "
                  + "delete and re-create with same location");
        } else {
          // this partition is need to alter, rather than delete
          partitionToAlter.put(entry.getKey(), entry.getValue());
          partitionToAlterLocation.put(entry.getKey(), entry.getValue());
          partitionToDelete.remove(entry.getKey());
          continue;
        }
      }

      try {
        Partition partitionInHive =
            hmsClient.run(c -> c.getPartition(db, tableName, entry.getValue().getValues()));
        String locationInHive = partitionInHive.getSd().getLocation();
        if (isPathEquals(location, locationInHive)) {
          partitionToAlter.put(entry.getKey(), entry.getValue());
          continue;
        }
        throw new CannotAlterHiveLocationException(
            "can't create new partition: "
                + partitionToString(entry.getValue())
                + ", this partition exists in hive with different location: "
                + locationInHive);
      } catch (NoSuchObjectException e) {
        partitions.put(entry.getKey(), entry.getValue());
      } catch (TException | InterruptedException e) {
        throw new RuntimeException(e);
      }
    }
    return partitions;
  }
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