private void checkDataFileInSameLocation(String partitionLocation, List<DataFile> files) {
    Path partitionPath = new Path(partitionLocation);
    for (DataFile df : files) {
      String fileDir = TableFileUtil.getFileDir(df.path().toString());
      Path dirPath = new Path(fileDir);
      if (!partitionPath.equals(dirPath)) {
        throw new CannotAlterHiveLocationException(
            "can't create new hive location: "
                + partitionLocation
                + " for data file: "
                + df.path().toString()
                + " is not under partition location path");
      }
    }
  }
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