public static List<DataFile> getDataFiles(Table table, String partitionPath, long fileSizeThreshold) {
    CloseableIterable<FileScanTask> fileScanTasks =
        table.newScan().useSnapshot(table.currentSnapshot().snapshotId()).ignoreResiduals().planFiles();
    CloseableIterable<FileScanTask> filteredFileScanTasks =
        CloseableIterable.filter(fileScanTasks, t -> {
          DataFile file = t.asFileScanTask().file();
          return shouldIncludeForCompaction(table, partitionPath, file, fileSizeThreshold);
        });
    return Lists.newArrayList(CloseableIterable.transform(filteredFileScanTasks, t -> t.file()));
  }
Returns table's list of data files as following:
 1. If the table is unpartitioned, returns all data files.
 2. If partitionPath is not provided, returns all data files that belong to the non-latest partition spec.
 3. If partitionPath is provided, returns all data files that belong to the 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