public static String[][] assignExecutors(
      List<? extends ScanTaskGroup<?>> taskGroups, List<String> executorLocations) {
    Map<Integer, JavaHash<StructLike>> partitionHashes = Maps.newHashMap();
    String[][] locations = new String[taskGroups.size()][];

    for (int index = 0; index < taskGroups.size(); index++) {
      locations[index] = assign(taskGroups.get(index), executorLocations, partitionHashes);
    }

    return locations;
  }
@Test
  public void testFileScanTaskWithUnpartitionedDeletes() {
    List<ScanTask> tasks1 =
        ImmutableList.of(
            new MockFileScanTask(
                mockDataFile(Row.of()),
                mockDeleteFiles(2, Row.of()),
                SCHEMA,
                PartitionSpec.unpartitioned()),
            new MockFileScanTask(
                mockDataFile(Row.of()),
                mockDeleteFiles(2, Row.of()),
                SCHEMA,
                PartitionSpec.unpartitioned()),
            new MockFileScanTask(
                mockDataFile(Row.of()),
                mockDeleteFiles(2, Row.of()),
                SCHEMA,
                PartitionSpec.unpartitioned()));
    ScanTaskGroup<ScanTask> taskGroup1 = new BaseScanTaskGroup<>(tasks1);
    List<ScanTask> tasks2 =
        ImmutableList.of(
            new MockFileScanTask(
                mockDataFile(null),
                mockDeleteFiles(2, null),
                SCHEMA,
                PartitionSpec.unpartitioned()),
            new MockFileScanTask(
                mockDataFile(null),
                mockDeleteFiles(2, null),
                SCHEMA,
                PartitionSpec.unpartitioned()),
            new MockFileScanTask(
                mockDataFile(null),
                mockDeleteFiles(2, null),
                SCHEMA,
                PartitionSpec.unpartitioned()));
    ScanTaskGroup<ScanTask> taskGroup2 = new BaseScanTaskGroup<>(tasks2);
    List<ScanTaskGroup<ScanTask>> taskGroups = ImmutableList.of(taskGroup1, taskGroup2);

    String[][] locations = SparkPlanningUtil.assignExecutors(taskGroups, EXECUTOR_LOCATIONS);

    // should not assign executors if the table is unpartitioned
    assertThat(locations.length).isEqualTo(2);
    assertThat(locations[0]).isEmpty();
    assertThat(locations[1]).isEmpty();
  }