@Override
  public RewriteFilesOutput execute() {
    LOG.info("Start processing table optimize task: {}", input);

    List<DataFile> dataFiles = new ArrayList<>();
    List<DeleteFile> deleteFiles = new ArrayList<>();

    long startTime = System.currentTimeMillis();
    try {
      if (!ArrayUtils.isEmpty(input.rePosDeletedDataFiles())) {
        deleteFiles = io.doAs(this::equalityToPosition);
      }

      if (!ArrayUtils.isEmpty(input.rewrittenDataFiles())) {
        dataFiles = io.doAs(this::rewriterDataFiles);
      }
    } finally {
      dataReader.close();
    }
    long duration = System.currentTimeMillis() - startTime;

    Map<String, String> summary = resolverSummary(dataFiles, deleteFiles, duration);
    return new RewriteFilesOutput(
        dataFiles.toArray(new DataFile[0]), deleteFiles.toArray(new DeleteFile[0]), summary);
  }
An abstract OptimizingExecutor implementation that rewrites the rewrittenDataFiles in
RewriteInput and generates new position delete for rePosDeletedDataFiles.
amoro-format-iceberg/src/main/java/org/apache/amoro/optimizing/AbstractRewriteFilesExecutor.java