private void checkOrphanFilesAndDelete(String partitionLocation, List<DataFile> dataFiles) {
    List<String> filePathCollect =
        dataFiles.stream().map(dataFile -> dataFile.path().toString()).collect(Collectors.toList());

    try (AuthenticatedHadoopFileIO io = table.io()) {
      for (FileInfo info : io.listPrefix(partitionLocation)) {
        if (!filePathCollect.contains(info.location())) {
          io.deleteFile(info.location());
          LOG.warn("Delete orphan file path: {}", info.location());
        }
      }
    }
  }
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