private List<DeleteFile> equalityToPosition() throws Exception {
    FileWriter<PositionDelete<Record>, DeleteWriteResult> posDeleteWriter = posWriter();

    try (CloseableIterator<Record> iterator = dataReader.readDeletedData().iterator()) {
      PositionDelete<Record> positionDelete = PositionDelete.create();
      while (iterator.hasNext()) {
        Record record = iterator.next();
        String filePath = (String) record.getField(MetadataColumns.FILE_PATH.name());
        Long rowPosition = (Long) record.getField(MetadataColumns.ROW_POSITION.name());
        positionDelete.set(filePath, rowPosition, null);
        if (posDeleteWriter instanceof SetTreeNode) {
          DataTreeNode dataTreeNode =
              DataTreeNode.ofId(
                  (Long) record.getField(org.apache.amoro.table.MetadataColumns.TREE_NODE_NAME));
          ((SetTreeNode) posDeleteWriter).setTreeNode(dataTreeNode);
        }
        posDeleteWriter.write(positionDelete);
      }
    } finally {
      posDeleteWriter.close();
    }

    return posDeleteWriter.result().deleteFiles();
  }
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