public static List<DeleteFile> getDeleteFiles(Table table, String partitionPath) {
    Table deletesTable =
        MetadataTableUtils.createMetadataTableInstance(table, MetadataTableType.POSITION_DELETES);
    CloseableIterable<ScanTask> deletesScanTasks = deletesTable.newBatchScan().planFiles();
    CloseableIterable<ScanTask> filteredDeletesScanTasks =
        CloseableIterable.filter(deletesScanTasks, t -> {
          DeleteFile file = ((PositionDeletesScanTask) t).file();
          return shouldIncludeForCompaction(table, partitionPath, file);
        });
    return Lists.newArrayList(CloseableIterable.transform(filteredDeletesScanTasks,
        t -> ((PositionDeletesScanTask) t).file()));
  }
Returns table's list of delete files as following:
 1. If the table is unpartitioned, returns all delete files.
 2. If partitionPath is not provided, returns all delete files that belong to the non-latest partition spec.
 3. If partitionPath is provided, returns all delete files that belong to corresponding partition.
@param table the iceberg table
@param partitionPath partition path
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/compaction/IcebergCompactionUtil.java