private static TableScan createTableScan(Table table, Configuration conf) {
    TableScan scan = table.newScan();

    long snapshotId = -1;
    try {
      snapshotId = conf.getLong(InputFormatConfig.SNAPSHOT_ID, -1);
    } catch (NumberFormatException e) {
      String version = conf.get(InputFormatConfig.SNAPSHOT_ID);
      SnapshotRef ref = table.refs().get(version);
      if (ref == null) {
        throw new RuntimeException("Cannot find matching snapshot ID or reference name for version " + version);
      }
      snapshotId = ref.snapshotId();
    }
    String refName = conf.get(InputFormatConfig.OUTPUT_TABLE_SNAPSHOT_REF);
    if (StringUtils.isNotEmpty(refName)) {
      scan = scan.useRef(HiveUtils.getTableSnapshotRef(refName));
    }
    if (snapshotId != -1) {
      scan = scan.useSnapshot(snapshotId);
    }

    long asOfTime = conf.getLong(InputFormatConfig.AS_OF_TIMESTAMP, -1);
    if (asOfTime != -1) {
      scan = scan.asOfTime(asOfTime);
    }

    return scan;
  }
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