private static void generateInputSplits(Scan<?, FileScanTask, CombinedScanTask> scan, Table table,
      String[] groupingPartitionColumns, Consumer<ScanTaskGroup<FileScanTask>> consumer) {
    if (groupingPartitionColumns == null) {
      try (CloseableIterable<CombinedScanTask> tasksIterable = scan.planTasks()) {
        tasksIterable.forEach(consumer);
      } catch (IOException e) {
        throw new UncheckedIOException(String.format("Failed to close table scan: %s", scan), e);
      }
    } else {
      final StructType groupingKeyType = Partitioning.groupingKeyType(
          table.schema().select(groupingPartitionColumns), table.specs().values());
      try (CloseableIterable<FileScanTask> taskIterable = scan.planFiles()) {
        final List<FileScanTask> tasks = Lists.newArrayList(taskIterable);
        final List<ScanTaskGroup<FileScanTask>> partitionScanTaskGroups =
            TableScanUtil.planTaskGroups(
                tasks,
                scan.targetSplitSize(),
                scan.splitLookback(),
                scan.splitOpenFileCost(),
                groupingKeyType);
        partitionScanTaskGroups.forEach(consumer);
      } catch (IOException e) {
        throw new UncheckedIOException(String.format("Failed to close table scan: %s", scan), e);
      }
    }
  }
Configures the {@code Job} to use the {@code IcebergInputFormat} and
returns a helper to add further configuration.

@param job the {@code Job} to configure
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/mapreduce/IcebergInputFormat.java